update update_birdnet2.sh
This commit is contained in:
@@ -1,27 +1,14 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# Second stage of update
|
# Second stage of update
|
||||||
birdnet_conf=/home/pi/BirdNET-Pi/birdnet.conf
|
birdnet_conf=/home/pi/BirdNET-Pi/birdnet.conf
|
||||||
|
|
||||||
# Stage 1 updates the 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
|
|
||||||
sudo -upi sed -i 's/=http:\/\/birdnetpi.local/=/g' ${birdnet_conf}
|
|
||||||
|
|
||||||
# Stage 2 updates the services
|
|
||||||
my_dir=${HOME}/BirdNET-Pi/scripts
|
my_dir=${HOME}/BirdNET-Pi/scripts
|
||||||
|
|
||||||
|
# Stage 1 updates the services
|
||||||
sudo ${my_dir}/update_services.sh
|
sudo ${my_dir}/update_services.sh
|
||||||
|
|
||||||
# Stage 2 restarts the services
|
# Stage 2 restarts the services
|
||||||
newservices=$(awk '/service/ && /systemctl/ && !/php/ {print $3}' ${my_dir}/install_services.sh | sort)
|
newservices=$(awk '/service/ && /systemctl/ && !/php/ {print $3}' ${my_dir}/install_services.sh | sort)
|
||||||
|
for i in ${newservices[@]};do
|
||||||
restart_newservices() {
|
|
||||||
for i in ${newservices[@]};do
|
|
||||||
sudo systemctl restart ${i}
|
sudo systemctl restart ${i}
|
||||||
done
|
done
|
||||||
}
|
|
||||||
|
|
||||||
restart_newservices
|
|
||||||
sudo systemctl restart extraction.timer
|
sudo systemctl restart extraction.timer
|
||||||
|
|||||||
Reference in New Issue
Block a user