only make these changes once

This commit is contained in:
Patrick McGuire
2021-10-20 11:52:00 -04:00
parent 064f5f6153
commit b6ce7c821b
+6 -4
View File
@@ -1,11 +1,13 @@
#!/usr/bin/env bash
# Second stage of update
birdnet_conf=/home/pi/BirdNET-Pi/birdnet.conf
# Stage 1 updates the birdnet.conf
sudo -upi sed -i 's/EXTRACTIONS_URL/BIRDNETPI_URL/g' /home/pi/BirdNET-Pi/birdnet.conf
echo "EXTRACTIONLOG_URL=" >> /home/pi/BirdNET-Pi/birdnet.conf
echo "BIRDNETLOG_URL=" >> /home/pi/BirdNET-Pi/birdnet.conf
sudo -upi sed -i 's/EXTRACTIONS_URL/BIRDNETPI_URL/g'
if ! grep EXTRACTIONLOG ${birdnet_conf} &> /dev/null;then
echo "EXTRACTIONLOG_URL=" >> ${birdnet_conf}
echo "BIRDNETLOG_URL=" >> ${birdnet_conf}
fi
# Stage 2 updates the services
my_dir=${HOME}/BirdNET-Pi/scripts
sudo ${my_dir}/update_services.sh