From 27dace0cbe0d8fc29a2c235a10e40e233ff1693a Mon Sep 17 00:00:00 2001 From: mcguirepr89 Date: Sat, 29 Jan 2022 14:19:25 -0500 Subject: [PATCH] making changes for avahi-aliases --- scripts/update_services.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/update_services.sh b/scripts/update_services.sh index 9b65664..18dbb4f 100755 --- a/scripts/update_services.sh +++ b/scripts/update_services.sh @@ -131,7 +131,13 @@ create_necessary_dirs() { fi sudo -u ${USER} ln -fs $(dirname ${my_dir})/scripts ${EXTRACTED} - if [ ! -z ${BIRDNETPI_URL} ];then + if [ -z ${BIRDNETPI_URL} ];then + sudo -u${USER} sed -i "s/birdnetpi.local/$(hostname).local/g" $(dirname ${my_dir})/homepage/*.html + phpfiles="$(grep -l birdnetpi.local ${my_dir}/*.php)" + for i in "${phpfiles[@]}";do + sudo -u${USER} sed -i "s/birdnetpi.local/$(hostname).local/g" ${i} + done + else BIRDNETPI_URL="$(echo ${BIRDNETPI_URL} | sed 's/\/\//\\\/\\\//g')" sudo -u${USER} sed -i "s/http:\/\/$(hostname).local/"${BIRDNETPI_URL}"/g" $(dirname ${my_dir})/homepage/*.html phpfiles="$(grep -l $(hostname).local ${my_dir}/*.php)"