From 9dbedd7799d1a841bc4288b640c2b845738c9f3a Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Sun, 3 Oct 2021 12:53:46 -0400 Subject: [PATCH 01/13] slowing down the analysis service to prevent unneeded restarts --- scripts/birdnet_analysis.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/scripts/birdnet_analysis.sh b/scripts/birdnet_analysis.sh index a4c7ccb..51e7146 100755 --- a/scripts/birdnet_analysis.sh +++ b/scripts/birdnet_analysis.sh @@ -74,20 +74,25 @@ run_analysis() { WEEK="$(echo "${WEEK_OF_YEAR} + 4" |bc -l)" fi - #WEEK=$(date +"%U") cd ${HOME}/BirdNET-Lite || exit 1 for i in "${files[@]}";do - FILE_LENGTH="$(ffmpeg -i ${1}/${i} 2>&1 \ - | awk -F. '/Duration/ {print $1}' \ - | cut -d':' -f3-4)" [ -z ${RECORDING_LENGTH} ] && RECORDING_LENGTH=12 [ ${RECORDING_LENGTH} == "60" ] && RECORDING_LENGTH=01:00 + FILE_LENGTH="$(ffmpeg -i ${1}/${i} 2>&1 | awk -F. '/Duration/ {print $1}' | cut -d':' -f3-4)" +#################################################################### working on this +set -x +[ -z $FILE_LENGTH ] && sleep "$(echo "${RECORDING_LENGTH}/3"|bc -l)" && continue if [ ${RECORDING_LENGTH} == "01:00" ];then - [ "${FILE_LENGTH}" == "${RECORDING_LENGTH}" ] || continue + until [ "$(ffmpeg -i ${1}/${i} 2>&1 | awk -F. '/Duration/ {print $1}' | cut -d':' -f3-4)" == "${RECORDING_LENGTH}" ];do + sleep 1 + done else - [ "${FILE_LENGTH}" == "00:${RECORDING_LENGTH}" ] || continue + until [ "$(ffmpeg -i ${1}/${i} 2>&1 | awk -F. '/Duration/ {print $1}' | cut -d':' -f3-4)" == "00:${RECORDING_LENGTH}" ];do + sleep 1 + done fi +#################################################################### working on this if [ -f ${1}/${i} ] && [ ! -f ${CUSTOM_LIST} ];then set -x From 6302bf62a113688fb02208264c514466e5becb30 Mon Sep 17 00:00:00 2001 From: mcguirepr89 <60325264+mcguirepr89@users.noreply.github.com> Date: Sun, 3 Oct 2021 12:56:07 -0400 Subject: [PATCH 02/13] Update README.md --- README.md | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index e8bb1a7..bb225d3 100644 --- a/README.md +++ b/README.md @@ -52,24 +52,9 @@ An installation one-liner is available below for RaspiOS-ARM64 meeting the prequ - *Note for Android users: it seems that the Pushed.co Mobile App does not work for Android devices, which is a huge bummer. If anyone knows of an Android alternative, or if anyone might be able to come up with a home-spun notification system, please let me know.* ## How to install -#### Option 1 (Recommended) -- Install All Services -1. In the terminal run: `curl -s https://raw.githubusercontent.com/mcguirepr89/BirdNET-Lite/rpi4/Birders_Guide_Installer.sh | bash` +Install All Services +1. In the terminal run: `curl -s https://raw.githubusercontent.com/mcguirepr89/BirdNET-Lite/rpialpha/Birders_Guide_Installer.sh | bash` -##### Options 2 & 3 require you setup 4GB of swapping. That step is included in the directions below. -#### Option 2 -- Pre-fill birdnet.conf -1. In the terminal run `git clone https://github.com/mcguirepr89/BirdNET-Lite.git ~/BirdNET-Lite` -1. You can copy the included *'birdnet.conf-defaults'* template to create and configure the BirdNET-Lite - to your needs before running the installer. Issue `cp ~/BirdNET-Lite/birdnet.conf-defaults ~/BirdNET-Lite/birdnet.conf`. - Edit the new *'birdnet.conf'* file to suit your needs and save it. - If you choose this method, the installation will be (nearly) non-interactive. -1. Setup zRAM swapping. Run `~/BirdNET-Lite/scripts/install_zram_service.sh && sudo reboot` -1. After the reboot, run `~/BirdNET-Lite/scripts/install_birdnet.sh` -#### Option 3 -- Interactive Installation -1. In the terminal run `git clone https://github.com/mcguirepr89/BirdNET-Lite.git ~/BirdNET-Lite` -1. Setup zRAM swapping. Run `~/BirdNET-Lite/scripts/install_zram_service.sh && sudo reboot` -1. After the reboot, run `~/BirdNET-Lite/scripts/install_birdnet.sh` -1. Follow the installation prompts to configure the BirdNET-Lite to your needs. -- Note: The installation should be run as a regular user. If run on an OS other than RaspiOS, be sure the regular user is in the sudoers file or the sudo group. ## Access your BirdNET-Lite If you configured BirdNET-Lite with the Caddy webserver, you can access the extractions locally at From fd1c17844cb5d70ff3b63ee52213e972dcd5ed4c Mon Sep 17 00:00:00 2001 From: mcguirepr89 <60325264+mcguirepr89@users.noreply.github.com> Date: Sun, 3 Oct 2021 13:22:26 -0400 Subject: [PATCH 03/13] Update Birders_Guide_Installer.sh --- Birders_Guide_Installer.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Birders_Guide_Installer.sh b/Birders_Guide_Installer.sh index 44065a0..bf8656a 100755 --- a/Birders_Guide_Installer.sh +++ b/Birders_Guide_Installer.sh @@ -44,7 +44,7 @@ EOF echo echo "Installing stage 2 installation script now." cd ~ - curl -s -O "https://raw.githubusercontent.com/mcguirepr89/BirdNET-Lite/rpi4/Birders_Guide_Installer.sh" + curl -s -O "https://raw.githubusercontent.com/mcguirepr89/BirdNET-Lite/rpialpha/Birders_Guide_Installer.sh" chmod +x Birders_Guide_Installer.sh cat << EOF | sudo tee /etc/systemd/user/birdnet-system-installer.service &> /dev/null [Unit] @@ -107,7 +107,7 @@ stage_2() { if [ ! -d ${my_dir} ];then cd ~ || exit 1 echo "Cloning the BirdNET-Lite repository in your home directory" - git clone -b rpi4 https://github.com/mcguirepr89/BirdNET-Lite.git ~/BirdNET-Lite + git clone -b rpialpha https://github.com/mcguirepr89/BirdNET-Lite.git ~/BirdNET-Lite fi if [ -f ${my_dir}/Birders_Guide_Installer_Configuration.txt ];then From c3211887c1651d644ca495d05ce962509931e95c Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Sun, 3 Oct 2021 13:22:47 -0400 Subject: [PATCH 04/13] better logging -- needs the African Penguin's csv output --- scripts/birdnet_analysis.sh | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/scripts/birdnet_analysis.sh b/scripts/birdnet_analysis.sh index 51e7146..3ad5df5 100755 --- a/scripts/birdnet_analysis.sh +++ b/scripts/birdnet_analysis.sh @@ -81,8 +81,8 @@ run_analysis() { [ ${RECORDING_LENGTH} == "60" ] && RECORDING_LENGTH=01:00 FILE_LENGTH="$(ffmpeg -i ${1}/${i} 2>&1 | awk -F. '/Duration/ {print $1}' | cut -d':' -f3-4)" #################################################################### working on this -set -x -[ -z $FILE_LENGTH ] && sleep "$(echo "${RECORDING_LENGTH}/3"|bc -l)" && continue + [ -z $FILE_LENGTH ] && sleep 2 && continue + echo "RECORDING_LENGTH set to ${RECORDING_LENGTH}" if [ ${RECORDING_LENGTH} == "01:00" ];then until [ "$(ffmpeg -i ${1}/${i} 2>&1 | awk -F. '/Duration/ {print $1}' | cut -d':' -f3-4)" == "${RECORDING_LENGTH}" ];do sleep 1 @@ -95,7 +95,15 @@ set -x #################################################################### working on this if [ -f ${1}/${i} ] && [ ! -f ${CUSTOM_LIST} ];then - set -x + echo "python3 analyze.py \ +--i "${1}/${i}" \ +--o "${1}/${i}.csv" \ +--lat "${LATITUDE}" \ +--lon "${LONGITUDE}" \ +--week "${WEEK}" \ +--overlap "${OVERLAP}" \ +--sensitivity "${SENSITIVITY}" \ +--min_conf "${CONFIDENCE}"" python3 analyze.py \ --i "${1}/${i}" \ --o "${1}/${i}.csv" \ @@ -105,9 +113,17 @@ set -x --overlap "${OVERLAP}" \ --sensitivity "${SENSITIVITY}" \ --min_conf "${CONFIDENCE}" - set +x elif [ -f ${1}/${i} ] && [ -f ${CUSTOM_LIST} ];then - set -x + echo "python3 analyze.py \ +--i "${1}/${i}" \ +--o "${1}/${i}.csv" \ +--lat "${LATITUDE}" \ +--lon "${LONGITUDE}" \ +--week "${WEEK}" \ +--overlap "${OVERLAP}" \ +--sensitivity "${SENSITIVITY}" \ +--min_conf "${CONFIDENCE}" \ +--custom_list "${CUSTOM_LIST}"" python3 analyze.py \ --i "${1}/${i}" \ --o "${1}/${i}.csv" \ @@ -118,7 +134,6 @@ set -x --sensitivity "${SENSITIVITY}" \ --min_conf "${CONFIDENCE}" \ --custom_list "${CUSTOM_LIST}" - set +x fi done } @@ -127,7 +142,7 @@ set -x # Takes one argument: # - {DIRECTORY} run_birdnet() { - echo "Starting run_birdnet() for \"${1:19}\"" + echo "Starting run_birdnet() for ${1:19}" get_files "${1}" move_analyzed "${1}" run_analysis "${1}" From 7f02419ceeef3eb83d236bf180e0fbb8a61b9cf4 Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Sun, 3 Oct 2021 13:30:01 -0400 Subject: [PATCH 05/13] removed some comments I made for myself --- scripts/birdnet_analysis.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/birdnet_analysis.sh b/scripts/birdnet_analysis.sh index 3ad5df5..d11662c 100755 --- a/scripts/birdnet_analysis.sh +++ b/scripts/birdnet_analysis.sh @@ -80,7 +80,6 @@ run_analysis() { [ -z ${RECORDING_LENGTH} ] && RECORDING_LENGTH=12 [ ${RECORDING_LENGTH} == "60" ] && RECORDING_LENGTH=01:00 FILE_LENGTH="$(ffmpeg -i ${1}/${i} 2>&1 | awk -F. '/Duration/ {print $1}' | cut -d':' -f3-4)" -#################################################################### working on this [ -z $FILE_LENGTH ] && sleep 2 && continue echo "RECORDING_LENGTH set to ${RECORDING_LENGTH}" if [ ${RECORDING_LENGTH} == "01:00" ];then @@ -92,7 +91,6 @@ run_analysis() { sleep 1 done fi -#################################################################### working on this if [ -f ${1}/${i} ] && [ ! -f ${CUSTOM_LIST} ];then echo "python3 analyze.py \ From 6faa1db7bdfeba63fbc9cdd5679cf89099dbbf9f Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Sun, 3 Oct 2021 15:29:38 -0400 Subject: [PATCH 06/13] fixed rebooting issue -- now deletes truncated audio files adding new index.html to support php buttons adding restart_services.php as first button --- scripts/birdnet_analysis.sh | 8 ++++++-- scripts/index.html | 7 +++++++ scripts/restart_birdnet.sh | 2 +- scripts/restart_services.php | 4 ++++ 4 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 scripts/index.html create mode 100644 scripts/restart_services.php diff --git a/scripts/birdnet_analysis.sh b/scripts/birdnet_analysis.sh index d11662c..72a8a37 100755 --- a/scripts/birdnet_analysis.sh +++ b/scripts/birdnet_analysis.sh @@ -76,19 +76,23 @@ run_analysis() { cd ${HOME}/BirdNET-Lite || exit 1 for i in "${files[@]}";do - [ -z ${RECORDING_LENGTH} ] && RECORDING_LENGTH=12 [ ${RECORDING_LENGTH} == "60" ] && RECORDING_LENGTH=01:00 FILE_LENGTH="$(ffmpeg -i ${1}/${i} 2>&1 | awk -F. '/Duration/ {print $1}' | cut -d':' -f3-4)" - [ -z $FILE_LENGTH ] && sleep 2 && continue + [ -z $FILE_LENGTH ] && sleep 3 && continue echo "RECORDING_LENGTH set to ${RECORDING_LENGTH}" + a=1 if [ ${RECORDING_LENGTH} == "01:00" ];then until [ "$(ffmpeg -i ${1}/${i} 2>&1 | awk -F. '/Duration/ {print $1}' | cut -d':' -f3-4)" == "${RECORDING_LENGTH}" ];do sleep 1 + [ $a -ge ${RECORDING_LENGTH} ] && sudo rm -f ${1}/${i} && break + a=$((a+1)) done else until [ "$(ffmpeg -i ${1}/${i} 2>&1 | awk -F. '/Duration/ {print $1}' | cut -d':' -f3-4)" == "00:${RECORDING_LENGTH}" ];do sleep 1 + [ $a -ge ${RECORDING_LENGTH} ] && sudo rm -f ${1}/${i} && break + a=$((a+1)) done fi diff --git a/scripts/index.html b/scripts/index.html new file mode 100644 index 0000000..269ab83 --- /dev/null +++ b/scripts/index.html @@ -0,0 +1,7 @@ +
+ +
+ +
+ +
diff --git a/scripts/restart_birdnet.sh b/scripts/restart_birdnet.sh index de456c2..cfc43a2 100755 --- a/scripts/restart_birdnet.sh +++ b/scripts/restart_birdnet.sh @@ -3,7 +3,7 @@ source /etc/birdnet/birdnet.conf sudo systemctl stop birdnet_recording.service -rm -rf ${RECS_DIR}/$(date +%B-%Y/%d-%A)/* +sudo rm -rf ${RECS_DIR}/$(date +%B-%Y/%d-%A)/* sudo systemctl start birdnet_recording.service sudo systemctl restart extraction.timer sudo systemctl restart birdnet_analysis.service diff --git a/scripts/restart_services.php b/scripts/restart_services.php new file mode 100644 index 0000000..f6be0aa --- /dev/null +++ b/scripts/restart_services.php @@ -0,0 +1,4 @@ + From fe6561374c0831739564651b5bafc95a35a9fb27 Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Sun, 3 Oct 2021 17:43:43 -0400 Subject: [PATCH 07/13] adding new php scripts --- scripts/extract_new_birdsounds.sh | 12 +++++------- scripts/index.html | 23 ++++++++++++++++++++--- scripts/reboot_system.php | 4 ++++ scripts/reboot_system.sh | 2 ++ scripts/restart_birdnet.sh | 20 +++++++++++++++++--- scripts/restart_birdnet_analysis.php | 4 ++++ scripts/restart_birdnet_analysis.sh | 3 +++ scripts/restart_birdnet_recording.php | 4 ++++ scripts/restart_birdnet_recording.sh | 3 +++ scripts/restart_caddy.php | 4 ++++ scripts/restart_caddy.sh | 3 +++ scripts/restart_extraction.php | 4 ++++ scripts/restart_extraction.sh | 3 +++ 13 files changed, 76 insertions(+), 13 deletions(-) create mode 100644 scripts/reboot_system.php create mode 100755 scripts/reboot_system.sh create mode 100644 scripts/restart_birdnet_analysis.php create mode 100755 scripts/restart_birdnet_analysis.sh create mode 100644 scripts/restart_birdnet_recording.php create mode 100755 scripts/restart_birdnet_recording.sh create mode 100644 scripts/restart_caddy.php create mode 100755 scripts/restart_caddy.sh create mode 100644 scripts/restart_extraction.php create mode 100755 scripts/restart_extraction.sh diff --git a/scripts/extract_new_birdsounds.sh b/scripts/extract_new_birdsounds.sh index fee138e..a7ff429 100755 --- a/scripts/extract_new_birdsounds.sh +++ b/scripts/extract_new_birdsounds.sh @@ -128,16 +128,14 @@ for h in "${SCAN_DIRS[@]}";do # directory. ### TESTING longer extraction context - set -x [ -z ${EXTRACTION_LENGTH} ] && EXTRACTION_LENGTH=6 - SPACER=$(echo "(${EXTRACTION_LENGTH} - 3 )/2" |bc -l) - START=$(echo "${START} - ${SPACER}"|bc -l) - END=$(echo "${END} + ${SPACER}"|bc -l) + SPACER=$(echo "scale=1;(${EXTRACTION_LENGTH} - 3 )/2" |bc -l) + START=$(echo "scale=1;${START} - ${SPACER}"|bc -l) + END=$(echo "scale=1;${END} + ${SPACER}"|bc -l) - if (( $(echo "${START} < 0" | bc -l) ));then START=0;fi - if (( $(echo "${END} > ${RECORDING_LENGTH}" | bc -l) ));then END=${RECORDING_LENGTH};fi + if (( $(echo "scale=1;${START} < 1" | bc -l) ));then START=0;fi + if (( $(echo "scale=1;${END} > ${RECORDING_LENGTH}" | bc -l) ));then END=${RECORDING_LENGTH};fi - set +x ffmpeg -hide_banner -loglevel error -nostdin -i "${h}/${OLDFILE}" \ -acodec copy -ss "${START}" -to "${END}"\ "${NEWSPECIES_BYDATE}/${a}-${NEWFILE}" diff --git a/scripts/index.html b/scripts/index.html index 269ab83..0e158b2 100644 --- a/scripts/index.html +++ b/scripts/index.html @@ -1,7 +1,24 @@
- +
-
- + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ diff --git a/scripts/reboot_system.php b/scripts/reboot_system.php new file mode 100644 index 0000000..2e385ad --- /dev/null +++ b/scripts/reboot_system.php @@ -0,0 +1,4 @@ + diff --git a/scripts/reboot_system.sh b/scripts/reboot_system.sh new file mode 100755 index 0000000..e45727e --- /dev/null +++ b/scripts/reboot_system.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +sudo reboot diff --git a/scripts/restart_birdnet.sh b/scripts/restart_birdnet.sh index cfc43a2..e42cf34 100755 --- a/scripts/restart_birdnet.sh +++ b/scripts/restart_birdnet.sh @@ -1,9 +1,23 @@ #!/usr/bin/env bash -# Restart services +# Restarts ALL services and removes ALL unprocessed audio source /etc/birdnet/birdnet.conf sudo systemctl stop birdnet_recording.service sudo rm -rf ${RECS_DIR}/$(date +%B-%Y/%d-%A)/* sudo systemctl start birdnet_recording.service -sudo systemctl restart extraction.timer -sudo systemctl restart birdnet_analysis.service + +SERVICES=(avahi-alias@birdlog.local.service +avahi-alias@birdnetsystem.local.service +avahi-alias@birdstats.local.service +avahi-alias@extractionlog.local.service +birdnet_analysis.service +birdnet_log.service +birdstats.service +extraction.timer +extractionlog.service +livestream.service) + +for i in "${SERVICES[@]}";do + sudo systemctl restart ${i} +done + diff --git a/scripts/restart_birdnet_analysis.php b/scripts/restart_birdnet_analysis.php new file mode 100644 index 0000000..2c050a1 --- /dev/null +++ b/scripts/restart_birdnet_analysis.php @@ -0,0 +1,4 @@ + diff --git a/scripts/restart_birdnet_analysis.sh b/scripts/restart_birdnet_analysis.sh new file mode 100755 index 0000000..c40b3e8 --- /dev/null +++ b/scripts/restart_birdnet_analysis.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Restars the main BirdNET analysis service +sudo systemctl restart birdnet_analysis.service diff --git a/scripts/restart_birdnet_recording.php b/scripts/restart_birdnet_recording.php new file mode 100644 index 0000000..9c61cd4 --- /dev/null +++ b/scripts/restart_birdnet_recording.php @@ -0,0 +1,4 @@ + diff --git a/scripts/restart_birdnet_recording.sh b/scripts/restart_birdnet_recording.sh new file mode 100755 index 0000000..bc9f5b8 --- /dev/null +++ b/scripts/restart_birdnet_recording.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Restars the BirdNET Recording service +sudo systemctl restart birdnet_recording.service diff --git a/scripts/restart_caddy.php b/scripts/restart_caddy.php new file mode 100644 index 0000000..3de0dd9 --- /dev/null +++ b/scripts/restart_caddy.php @@ -0,0 +1,4 @@ + diff --git a/scripts/restart_caddy.sh b/scripts/restart_caddy.sh new file mode 100755 index 0000000..43edcca --- /dev/null +++ b/scripts/restart_caddy.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Restars the caddy webserver +sudo systemctl restart caddy diff --git a/scripts/restart_extraction.php b/scripts/restart_extraction.php new file mode 100644 index 0000000..f847580 --- /dev/null +++ b/scripts/restart_extraction.php @@ -0,0 +1,4 @@ + diff --git a/scripts/restart_extraction.sh b/scripts/restart_extraction.sh new file mode 100755 index 0000000..81aadf0 --- /dev/null +++ b/scripts/restart_extraction.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Restars the BirdNET Extraction service +sudo systemctl restart extraction.service From 214dce6c444abb2fd05b6bb8820d4fb716af66b1 Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Sun, 3 Oct 2021 18:13:04 -0400 Subject: [PATCH 08/13] added php installation, configuration, and sudo rule for caddy added php line to Caddyfile --- scripts/install_services.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/scripts/install_services.sh b/scripts/install_services.sh index 0a3365d..427a7d5 100755 --- a/scripts/install_services.sh +++ b/scripts/install_services.sh @@ -77,6 +77,7 @@ create_necessary_dirs() { [ -d ${EXTRACTED}/By_Common_Name ] || sudo -u ${USER} mkdir -p ${EXTRACTED}/By_Common_Name [ -d ${EXTRACTED}/By_Scientific_Name ] || sudo -u ${USER} mkdir -p ${EXTRACTED}/By_Scientific_Name [ -d ${PROCESSED} ] || sudo -u ${USER} mkdir -p ${PROCESSED} + [ -L ${EXTRACTED}/scripts ] || sudo -u ${USER} ln -s $(dirname ${my_dir})/scripts ${EXTRACTED} } install_alsa() { @@ -198,6 +199,7 @@ ${EXTRACTIONS_URL} { birdnet ${HASHWORD} } reverse_proxy /stream localhost:8000 + php_fastcgi unix//run/php/php7.3-fpm.sock } http://birdnetsystem.local { @@ -210,6 +212,7 @@ http://birdnetsystem.local { birdnet ${HASHWORD} } reverse_proxy /stream localhost:8000 + php_fastcgi unix//run/php/php7.3-fpm.sock } http://birdlog.local { @@ -315,6 +318,23 @@ EOF systemctl enable --now birdstats.service } +install_php() { + if ! which pip &> /dev/null || ! which php-fpm7.3;then + echo "Installing PHP and PHP-FPM" + apt -qq update + apt install -qqy php php-fpm + else + echo "PHP and PHP-FPM installed" + fi + echo "Configuring PHP for Caddy" + sed -i 's/www-data/caddy/g' /etc/php/7.3/fpm/pool.d/www.conf + systemctl restart php7.3-fpm.service + echo "Adding Caddy sudoers rule" + cat << EOF > /etc/sudoers.d/010_caddy-nopasswd +caddy ALL=(ALL) NOPASSWD: ALL +EOF + chmod 0440 /etc/sudoers.d/010_caddy-nopasswd +} install_icecast() { if ! which icecast2;then @@ -422,6 +442,7 @@ install_selected_services() { install_Caddyfile install_avahi_aliases install_gotty_logs + install_php fi if [ ! -z "${ICE_PWD}" ];then From cadf8b90b894701e783080649d823598dfe9d20d Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Sun, 3 Oct 2021 18:14:46 -0400 Subject: [PATCH 09/13] added new scripts to uninstall --- scripts/uninstall.sh | 51 +++++++++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/scripts/uninstall.sh b/scripts/uninstall.sh index 4fe4ee0..c8f2f53 100755 --- a/scripts/uninstall.sh +++ b/scripts/uninstall.sh @@ -3,26 +3,37 @@ # set -x # Uncomment to debug trap 'rm -f ${TMPFILE}' EXIT source /etc/birdnet/birdnet.conf &> /dev/null -SCRIPTS=(/usr/local/bin/birdnet_analysis.sh -/usr/local/bin/birdnet_recording.sh -/usr/local/bin/birdnet_stats.sh -/usr/local/bin/cleanup.sh -/usr/local/bin/clear_all_data.sh -/usr/local/bin/disk_usage.sh -/usr/local/bin/dump_logs.sh -/usr/local/bin/extract_new_birdsounds.sh -/usr/local/bin/install_birdnet.sh -/usr/local/bin/install_config.sh -/usr/local/bin/install_services.sh -/usr/local/bin/install_tmux_services.sh -/usr/local/bin/install_zram_service.sh -/usr/local/bin/livestream.sh -/usr/local/bin/pretty_date.sh -/usr/local/bin/reconfigure_birdnet.sh -/usr/local/bin/restart_birdnet.sh -/usr/local/bin/species_notifier.sh -/usr/local/bin/uninstall.sh -/usr/local/bin/update_species.sh +SCRIPTS=(birdnet_analysis.sh +birdnet_recording.sh +birdnet_stats.sh +cleanup.sh +clear_all_data.sh +disk_usage.sh +dump_logs.sh +extract_new_birdsounds.sh +install_birdnet.sh +install_config.sh +install_services.sh +install_tmux_services.sh +install_zram_service.sh +livestream.sh +pretty_date.sh +reboot_system.php +reboot_system.sh +reconfigure_birdnet.sh +restart_birdnet_analysis.php +restart_birdnet_analysis.sh +restart_birdnet_recording.php +restart_birdnet_recording.sh +restart_birdnet.sh +restart_caddy.php +restart_caddy.sh +restart_extraction.php +restart_extraction.sh +restart_services.php +species_notifier.sh +uninstall.sh +update_species.sh ${HOME}/.gotty) From cc0361c389d3359178463a960c904f6082459c13 Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Sun, 3 Oct 2021 18:15:27 -0400 Subject: [PATCH 10/13] added an index.html removal after /usr/local/bin copy --- scripts/install_services.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/install_services.sh b/scripts/install_services.sh index 427a7d5..e4d8ffb 100755 --- a/scripts/install_services.sh +++ b/scripts/install_services.sh @@ -12,6 +12,7 @@ CONFIG_FILE="$(dirname ${my_dir})/birdnet.conf" install_scripts() { echo "Installing BirdNET-Lite scripts to /usr/local/bin" ln -sf ${my_dir}/* /usr/local/bin/ + rm /usr/local/bin/index.html } install_birdnet_analysis() { From b5d55e6a9904dfee6c759572f8ba756975ab5930 Mon Sep 17 00:00:00 2001 From: mcguirepr89 <60325264+mcguirepr89@users.noreply.github.com> Date: Sun, 3 Oct 2021 19:32:02 -0400 Subject: [PATCH 11/13] Update index.html --- templates/index.html | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/templates/index.html b/templates/index.html index bd3d304..0981967 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,7 +1,8 @@ + - BirdNET-Lite Extractions + BirdNET-Lite System