Update 99-run.sh

This commit is contained in:
Alexandre
2024-04-27 21:26:27 +02:00
committed by GitHub
parent d325f4c8a9
commit 69cec773b0

View File

@@ -17,13 +17,23 @@ service dbus start
# Symlink files
bashio::log.info "Ensuring files are in /config ; please customize as needed"
for files in /etc/birdnet/birdnet.conf "$HOME/BirdNET-Pi/scripts/birds.db"; do
chown -R 1000:1000 /config /etc/birdnet
for files in "$HOME/BirdNET-Pi/birdnet.conf" "$HOME/BirdNET-Pi/scripts/birds.db"; do
filename="${files##*/}"
if [ ! -f /config/"$filename" ]; then cp "$files" /config/; fi
if [ -f "$files" ]; then rm "$files"; fi
chown 1000:1000 /config/"$filename"
ln -s /config/"$filename" "$files"
chown 1000:1000 -h "$files"
echo "... setting $filename"
if [ ! -f /config/"$filename" ]; then echo "... copying $filename" && sudo -u pi mv "$files" /config/; fi
if [ -e "$files" ]; then rm "$files"; fi
chmod 777 /config/*
sudo -u pi ln -fs /config/"$filename" "$files"
sudo -u pi ln -fs /config/"$filename" /etc/birdnet/"$filename"
done
for files in "apprise.txt"
if [ -f "$files" ]; then
echo "... /config/$files exists, it will be sent to BirdNET"
else
echo "... /config/$files does not exist, if created before restarting it will be sent to BirdNET"
fi
done
# Starting services