Merge branch 'main' into notifications

This commit is contained in:
ehpersonal38
2022-05-07 12:15:08 -04:00
18 changed files with 339 additions and 321 deletions
Executable → Regular
+4 -11
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Update BirdNET-Pi
# Update BirdNET-Pi's Git Repo
source /etc/birdnet/birdnet.conf
trap 'exit 1' SIGINT SIGHUP
USER=$(awk -F: '/1000/ {print $1}' /etc/passwd)
@@ -11,14 +11,7 @@ sudo -u${USER} git -C $my_dir pull -f
sudo systemctl daemon-reload
sudo -u${USER} git -C $my_dir stash pop
sudo ln -sf $my_dir/* /usr/local/bin/
if ! grep python3 <(head -n1 $my_dir/analyze.py);then
echo "Ensure all python scripts use the virtual environment"
sed -si "1 i\\#\!$HOME/BirdNET-Pi/birdnet/bin/python3" $my_dir/*.py
fi
if ! grep PRIVACY_MODE /etc/birdnet/birdnet.conf;then
sudo -u${USER} echo "PRIVACY_MODE=off" >> /etc/birdnet/birdnet.conf
fi
if ! grep NOTIFY_RUN_CHANNEL_ID /etc/birdnet/birdnet.conf;then
sudo -u${USER} echo "NOTIFY_RUN_CHANNEL_ID=" >> /etc/birdnet/birdnet.conf
fi
# The script below handles changes to the host system
# Any additions to the updater should be placed in that file.
sudo $my_dir/update_birdnet_snippets.sh