smarter install (hopefully) allows to pre-set hostname

updated config and advanced for phone viewing
This commit is contained in:
mcguirepr89
2022-01-29 13:04:35 -05:00
parent 31f2edbd2a
commit c813031feb
5 changed files with 174 additions and 37 deletions
+2 -2
View File
@@ -12,7 +12,7 @@ gotty_url="https://github.com/yudai/gotty/releases/download/v1.0.1/gotty_linux_a
config_file="$(dirname ${my_dir})/birdnet.conf"
set_hostname() {
if [ "$(hostname)" != "birdnetpi" ];then
if [ "$(hostname)" == "raspberrypi" ];then
echo "Setting hostname to 'birdnetpi'"
hostnamectl set-hostname birdnetpi
sed -i 's/raspberrypi/birdnetpi/g' /etc/hosts
@@ -326,7 +326,7 @@ ExecStart=/bin/bash -c "/usr/bin/avahi-publish -a -R %I $(hostname -I |cut -d' '
[Install]
WantedBy=multi-user.target
EOF
systemctl enable avahi-alias@birdnetpi.local.service
systemctl enable avahi-alias@$(hostname).local.service
}
install_spectrogram_service() {