fixing restart_services
This commit is contained in:
@@ -320,7 +320,9 @@ run_birdnet() {
|
|||||||
run_analysis "${1}"
|
run_analysis "${1}"
|
||||||
}
|
}
|
||||||
|
|
||||||
date
|
until grep 5050 <(netstat -tulpn 2>&1) &> /dev/null 2>&1;do
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
|
||||||
if [ $(find ${RECS_DIR} -maxdepth 1 -name '*wav' | wc -l) -gt 0 ];then
|
if [ $(find ${RECS_DIR} -maxdepth 1 -name '*wav' | wc -l) -gt 0 ];then
|
||||||
run_birdnet "${RECS_DIR}"
|
run_birdnet "${RECS_DIR}"
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
journalctl --no-hostname -o short -fu birdnet_analysis -ubirdnet_server -uextraction | sed "s/$(date "+%b %d ")//g"
|
journalctl --no-hostname -q -o short -fu birdnet_analysis -ubirdnet_server -uextraction | sed "s/$(date "+%b %d ")//g"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ echo 'zram' | sudo tee /etc/modules-load.d/zram.conf
|
|||||||
sudo touch /etc/modprobe.d/zram.conf
|
sudo touch /etc/modprobe.d/zram.conf
|
||||||
echo 'options zram num_devices=1' | sudo tee /etc/modprobe.d/zram.conf
|
echo 'options zram num_devices=1' | sudo tee /etc/modprobe.d/zram.conf
|
||||||
sudo touch /etc/udev/rules.d/99-zram.rules
|
sudo touch /etc/udev/rules.d/99-zram.rules
|
||||||
echo 'KERNEL=="zram0", ATTR{disksize}="4G",TAG+="systemd"' \
|
echo 'KERNEL=="zram0", ATTR{disksize}="2G",TAG+="systemd"' \
|
||||||
| sudo tee /etc/udev/rules.d/99-zram.rules
|
| sudo tee /etc/udev/rules.d/99-zram.rules
|
||||||
sudo touch /etc/systemd/system/zram.service
|
sudo touch /etc/systemd/system/zram.service
|
||||||
echo "Installing zram.service"
|
echo "Installing zram.service"
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ source /etc/birdnet/birdnet.conf
|
|||||||
set -x
|
set -x
|
||||||
my_dir=/home/pi/BirdNET-Pi/scripts
|
my_dir=/home/pi/BirdNET-Pi/scripts
|
||||||
|
|
||||||
|
sudo systemctl stop birdnet_server.service
|
||||||
|
sudo pkill server.py
|
||||||
sudo systemctl stop birdnet_recording.service
|
sudo systemctl stop birdnet_recording.service
|
||||||
sudo rm -rf ${RECS_DIR}/$(date +%B-%Y/%d-%A)/*
|
sudo rm -rf ${RECS_DIR}/$(date +%B-%Y/%d-%A)/*
|
||||||
services=(web_terminal.service
|
services=(web_terminal.service
|
||||||
@@ -15,11 +17,13 @@ extraction.timer
|
|||||||
extraction.service
|
extraction.service
|
||||||
chart_viewer.service
|
chart_viewer.service
|
||||||
birdnet_recording.service
|
birdnet_recording.service
|
||||||
birdnet_log.service
|
birdnet_log.service)
|
||||||
birdnet_server.service
|
|
||||||
birdnet_analysis.service)
|
|
||||||
|
|
||||||
sudo pkill server.py
|
|
||||||
for i in "${services[@]}";do
|
for i in "${services[@]}";do
|
||||||
sudo systemctl restart "${i}"
|
sudo systemctl restart "${i}"
|
||||||
done
|
done
|
||||||
|
until grep 5050 <(netstat -tulpn 2>&1);do
|
||||||
|
sudo systemctl restart birdnet_server.service
|
||||||
|
sleep 30
|
||||||
|
done
|
||||||
|
sudo systemctl restart birdnet_analysis.service
|
||||||
|
|||||||
+2
-3
@@ -328,8 +328,7 @@ def handle_client(conn, addr):
|
|||||||
# Write detections to Database
|
# Write detections to Database
|
||||||
myReturn = ''
|
myReturn = ''
|
||||||
for i in detections:
|
for i in detections:
|
||||||
print("\n", detections[i][0],"\n")
|
myReturn += str(i) + '-' + str(detections[i][0]) + '\n'
|
||||||
myReturn += str(detections[i][0]) + '||'
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -414,7 +413,7 @@ def handle_client(conn, addr):
|
|||||||
print("Detection POST Response Status - ", response.status_code)
|
print("Detection POST Response Status - ", response.status_code)
|
||||||
|
|
||||||
|
|
||||||
conn.send("Msg received".encode(FORMAT))
|
conn.send(myReturn.encode(FORMAT))
|
||||||
|
|
||||||
#time.sleep(3)
|
#time.sleep(3)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user