From 3ae95ce587c0b2730689e7273a5913bfab77cda3 Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Fri, 15 Oct 2021 15:06:58 -0400 Subject: [PATCH] adding stop core services button --- scripts/index.html | 4 ++++ scripts/stop_core_services.php | 4 ++++ scripts/stop_core_services.sh | 12 ++++++++++++ scripts/update_birdnet.php | 4 ++++ 4 files changed, 24 insertions(+) create mode 100644 scripts/stop_core_services.php create mode 100755 scripts/stop_core_services.sh create mode 100644 scripts/update_birdnet.php diff --git a/scripts/index.html b/scripts/index.html index 16b861a..d137567 100644 --- a/scripts/index.html +++ b/scripts/index.html @@ -2,6 +2,10 @@ +
+ +
+
diff --git a/scripts/stop_core_services.php b/scripts/stop_core_services.php new file mode 100644 index 0000000..e335b68 --- /dev/null +++ b/scripts/stop_core_services.php @@ -0,0 +1,4 @@ + diff --git a/scripts/stop_core_services.sh b/scripts/stop_core_services.sh new file mode 100755 index 0000000..2f2c8f4 --- /dev/null +++ b/scripts/stop_core_services.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +# Restarts ALL services and removes ALL unprocessed audio + + +services=(birdnet_recording.service +birdnet_analysis.service +extraction.timer) + +for i in "${services[@]}";do + sudo systemctl stop ${i} +done +sudo rm -rf ${RECS_DIR}/$(date +%B-%Y/%d-%A)/* diff --git a/scripts/update_birdnet.php b/scripts/update_birdnet.php new file mode 100644 index 0000000..ff20b68 --- /dev/null +++ b/scripts/update_birdnet.php @@ -0,0 +1,4 @@ + /tmp/phpupdate.log 2&>1"); +header('Location: http://birdnetpi.local/index.html?success=true'); +?>