making changes for avahi-aliases

This commit is contained in:
mcguirepr89
2022-01-29 14:19:25 -05:00
parent 3c2d18811b
commit 27dace0cbe
+7 -1
View File
@@ -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)"