From b6ce7c821ba7f19a77aaa87ba999335afc6c3752 Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Wed, 20 Oct 2021 11:52:00 -0400 Subject: [PATCH] only make these changes once --- scripts/update_birdnet2.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/update_birdnet2.sh b/scripts/update_birdnet2.sh index 6076cca..05a98cd 100755 --- a/scripts/update_birdnet2.sh +++ b/scripts/update_birdnet2.sh @@ -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