From ad6dc4c356336b759d091083d065c0286f4ca7d0 Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Fri, 8 Oct 2021 12:57:28 -0400 Subject: [PATCH] renaming project birdingpi --- birdnet.conf-defaults | 8 ++++---- scripts/birdnet_analysis.sh | 4 ++-- scripts/clear_all_data.php | 4 ++-- scripts/clear_all_data.sh | 10 +++++----- scripts/dump_logs.sh | 8 ++++---- scripts/edit_birdnet.conf.php | 4 ++-- scripts/install_birdnet.sh | 10 +++++----- scripts/install_config.sh | 10 +++++----- scripts/install_services.sh | 12 ++++++------ scripts/install_tmux_services.sh | 4 ++-- scripts/reboot_system.php | 4 ++-- scripts/reconfigure_birdnet.sh | 8 ++++---- scripts/restart_birdnet_analysis.php | 4 ++-- scripts/restart_birdnet_recording.php | 4 ++-- scripts/restart_caddy.php | 4 ++-- scripts/restart_extraction.php | 4 ++-- scripts/restart_services.php | 4 ++-- scripts/shutdown_system.php | 4 ++-- scripts/spectrogram.php | 2 +- scripts/spectrogram.sh | 2 +- scripts/uninstall.sh | 2 +- templates/Caddyfile_livestream | 2 +- templates/Caddyfile_nostream | 2 +- templates/cleanup.cron | 1 + templates/livestream.service | 2 +- templates/tmux.conf | 4 ++-- 26 files changed, 64 insertions(+), 63 deletions(-) diff --git a/birdnet.conf-defaults b/birdnet.conf-defaults index 569b557..3a46e45 100644 --- a/birdnet.conf-defaults +++ b/birdnet.conf-defaults @@ -105,7 +105,7 @@ REMOTE_RECS_DIR= ## EXTRACTIONS_URL is the URL where the extractions, data-set, and live-stream ## will be web-hosted. If you do not own a domain, or would just prefer to keep -## BirdNET-Lite on your local network, you can set this to http://localhost. +## Birding-Pi on your local network, you can set this to http://localhost. ## Setting this (even to http://localhost) will also allow you to enable the ## GoTTY web logging features below. @@ -152,10 +152,10 @@ PUSHED_APP_SECRET= # Keep this EMPTY if you do not want to install NoMachine. # ## INSTALL_NOMACHINE is simply a setting that can be enabled to install -## NoMachine alongside the BirdNET-Lite for remote desktop access. This in- +## NoMachine alongside the Birding-Pi for remote desktop access. This in- ## staller assumes personal use. Please reference the LICENSE file included ## in this repository for more information. -## Set this to Y or y to install NoMachine alongside the BirdNET-Lite +## Set this to Y or y to install NoMachine alongside the Birding-Pi INSTALL_NOMACHINE= @@ -195,7 +195,7 @@ EXTRACTED=${RECS_DIR}/Extracted ## change this variable between data-sets to preserve records of disparate ## data-sets according to name. -IDFILE=${HOME}/BirdNET-Lite/IdentifiedSoFar.txt +IDFILE=${HOME}/Birding-Pi/IdentifiedSoFar.txt ## OVERLAP is the value in seconds which BirdNET should use when analyzing ## the data. The values must be between 0.0-2.9. diff --git a/scripts/birdnet_analysis.sh b/scripts/birdnet_analysis.sh index 0e99b0d..178d9d4 100755 --- a/scripts/birdnet_analysis.sh +++ b/scripts/birdnet_analysis.sh @@ -22,7 +22,7 @@ if ! diff ${LAST_RUN} ${THIS_RUN};then done fi -CUSTOM_LIST="/home/pi/BirdNET-Lite/custom_species_list.txt" +CUSTOM_LIST="/home/pi/Birding-Pi/custom_species_list.txt" # Create an array of the audio files # Takes one argument: @@ -75,7 +75,7 @@ run_analysis() { WEEK="$(echo "${WEEK_OF_YEAR} + 4" |bc -l)" fi - cd ${HOME}/BirdNET-Lite || exit 1 + cd ${HOME}/Birding-Pi || exit 1 for i in "${files[@]}";do echo "${1}/${i}" > ./analyzing_now.txt [ -z ${RECORDING_LENGTH} ] && RECORDING_LENGTH=12 diff --git a/scripts/clear_all_data.php b/scripts/clear_all_data.php index 606aa78..8a30a27 100644 --- a/scripts/clear_all_data.php +++ b/scripts/clear_all_data.php @@ -1,4 +1,4 @@ diff --git a/scripts/clear_all_data.sh b/scripts/clear_all_data.sh index 4584d70..50c9bac 100755 --- a/scripts/clear_all_data.sh +++ b/scripts/clear_all_data.sh @@ -15,12 +15,12 @@ echo "Recreating necessary directories" [ -d ${EXTRACTED}/By_Date ] || sudo -u ${BIRDNET_USER} mkdir -p ${EXTRACTED}/By_Date [ -d ${EXTRACTED}/By_Common_Name ] || sudo -u ${BIRDNET_USER} mkdir -p ${EXTRACTED}/By_Common_Name [ -d ${EXTRACTED}/By_Scientific_Name ] || sudo -u ${BIRDNET_USER} mkdir -p ${EXTRACTED}/By_Scientific_Name -sudo -u ${BIRDNET_USER} ln -s /home/pi/BirdNET-Lite/templates/index.html ${EXTRACTED} +sudo -u ${BIRDNET_USER} ln -s /home/pi/Birding-Pi/templates/index.html ${EXTRACTED} [ -d ${PROCESSED} ] || sudo -u ${BIRDNET_USER} mkdir -p ${PROCESSED} -[ -L ${EXTRACTED}/scripts ] || sudo -u ${BIRDNET_USER} ln -s /home/pi/BirdNET-Lite/scripts ${EXTRACTED}/ -[ -L ${EXTRACTED}/spectrogram.php ] || sudo -u ${BIRDNET_USER} ln -s /home/pi/BirdNET-Lite/scripts/spectrogram.php ${EXTRACTED} -[ -L ${EXTRACTED}/spectrogram.sh ] || sudo -u ${BIRDNET_USER} ln -s /home/pi/BirdNET-Lite/scripts/spectrogram.sh ${EXTRACTED} +[ -L ${EXTRACTED}/scripts ] || sudo -u ${BIRDNET_USER} ln -s /home/pi/Birding-Pi/scripts ${EXTRACTED}/ +[ -L ${EXTRACTED}/spectrogram.php ] || sudo -u ${BIRDNET_USER} ln -s /home/pi/Birding-Pi/scripts/spectrogram.php ${EXTRACTED} +[ -L ${EXTRACTED}/spectrogram.sh ] || sudo -u ${BIRDNET_USER} ln -s /home/pi/Birding-Pi/scripts/spectrogram.sh ${EXTRACTED} -sudo -u ${BIRDNET_USER} cp ~/BirdNET-Lite/templates/index.html ${EXTRACTED}/ +sudo -u ${BIRDNET_USER} cp ~/Birding-Pi/templates/index.html ${EXTRACTED}/ echo "Restarting services" sudo systemctl restart birdnet_recording.service diff --git a/scripts/dump_logs.sh b/scripts/dump_logs.sh index e3f7150..7fa32cd 100755 --- a/scripts/dump_logs.sh +++ b/scripts/dump_logs.sh @@ -2,7 +2,7 @@ # A comprehensive log dumper # set -x # Uncomment to debug source /etc/birdnet/birdnet.conf &> /dev/null -LOG_DIR="${HOME}/BirdNET-Lite/logs" +LOG_DIR="${HOME}/Birding-Pi/logs" SERVICES=(avahi-alias@.service birdnet_analysis.service birdnet_log.service @@ -29,7 +29,7 @@ for i in "${SERVICES[@]}";do done # Create password-removed birdnet.conf -sed -e '/PWD=/d' ${HOME}/BirdNET-Lite/birdnet.conf > ${LOG_DIR}/birdnet.conf +sed -e '/PWD=/d' ${HOME}/Birding-Pi/birdnet.conf > ${LOG_DIR}/birdnet.conf # Create password-removed Caddyfile if [ -f /etc/caddy/Caddyfile ];then @@ -57,6 +57,6 @@ for i in "${CALLS[@]}";do done # TAR the logs into a ball -tar --remove-files -cvpzf ${HOME}/BirdNET-Lite/logs.tar.gz ${LOG_DIR} &> /dev/null +tar --remove-files -cvpzf ${HOME}/Birding-Pi/logs.tar.gz ${LOG_DIR} &> /dev/null # Finished -echo "Your compressed logs are located at ${HOME}/BirdNET-Lite/logs.tar.gz" +echo "Your compressed logs are located at ${HOME}/Birding-Pi/logs.tar.gz" diff --git a/scripts/edit_birdnet.conf.php b/scripts/edit_birdnet.conf.php index 6fb7952..9ea36ac 100644 --- a/scripts/edit_birdnet.conf.php +++ b/scripts/edit_birdnet.conf.php @@ -1,4 +1,4 @@ diff --git a/scripts/install_birdnet.sh b/scripts/install_birdnet.sh index 5f3789b..af8d691 100755 --- a/scripts/install_birdnet.sh +++ b/scripts/install_birdnet.sh @@ -7,7 +7,7 @@ trap '${my_dir}/dump_logs.sh && echo -e "\n\nExiting the installation. Goodbye!" cd $my_dir || exit 1 if [ "$(uname -m)" != "aarch64" ];then - echo "BirdNET-Lite requires a 64-bit OS. + echo "Birding-Pi requires a 64-bit OS. It looks like your operating system is using $(uname -m), but would need to be aarch64. Please take a look at https://birdnetwiki.pmcgui.xyz for more @@ -46,7 +46,7 @@ install_deps() { } install_birdnet() { - cd ~/BirdNET-Lite || exit 1 + cd ~/Birding-Pi || exit 1 echo "Upgrading pip, wheel, and setuptools" sudo pip3 install --upgrade pip wheel setuptools echo "Fetching the TFLite pre-built binaries" @@ -65,7 +65,7 @@ install_birdnet() { read -sp "\ Be sure you have read the software license before installing. This is -available in the BirdNET-Lite directory as "LICENSE" +available in the Birding-Pi directory as "LICENSE" If you DO NOT want to install BirdNET and the birdnet_analysis.service, press Ctrl+C to cancel. If you DO wish to install BirdNET and the birdnet_analysis.service, press ENTER to continue with the installation." @@ -94,13 +94,13 @@ echo " BirdNet is installed!! http://birdnetsystem.local to see your extractions, http://birdlog.local to see the log output of the birdnet_analysis.service, http://extractionlog.local to see the log output of the extraction.service, and - http://birdstats.local to see the BirdNET-Lite Report" + http://birdstats.local to see the Birding-Pi Report" echo read -n1 -p " Would you like to run the birdnet_analysis.service now?" YN echo case $YN in [Yy] ) sudo systemctl start birdnet_analysis.service \ && journalctl -fu birdnet_analysis;; -* ) echo " Thanks for installing BirdNET-Lite!! +* ) echo " Thanks for installing Birding-Pi!! I hope it was helpful!";; esac diff --git a/scripts/install_config.sh b/scripts/install_config.sh index c1402b7..39246f5 100755 --- a/scripts/install_config.sh +++ b/scripts/install_config.sh @@ -298,7 +298,7 @@ REMOTE_RECS_DIR=${REMOTE_RECS_DIR} ## EXTRACTIONS_URL is the URL where the extractions, data-set, and live-stream ## will be web-hosted. If you do not own a domain, or would just prefer to keep -## BirdNET-Lite on your local network, you can set this to http://localhost. +## Birding-Pi on your local network, you can set this to http://localhost. ## Setting this (even to http://localhost) will also allow you to enable the ## GoTTY web logging features below. @@ -345,10 +345,10 @@ PUSHED_APP_SECRET=${PUSHED_APP_SECRET} # Keep this EMPTY if you do not want to install NoMachine. # ## INSTALL_NOMACHINE is simply a setting that can be enabled to install -## NoMachine alongside the BirdNET-Lite for remote desktop access. This in- +## NoMachine alongside the Birding-Pi for remote desktop access. This in- ## staller assumes personal use. Please reference the LICENSE file included ## in this repository for more information. -## Set this to Y or y to install NoMachine alongside the BirdNET-Lite +## Set this to Y or y to install NoMachine alongside the Birding-Pi INSTALL_NOMACHINE=${INSTALL_NOMACHINE} @@ -388,7 +388,7 @@ EXTRACTED=${RECS_DIR}/Extracted ## change this variable between data-sets to preserve records of disparate ## data-sets according to name. -IDFILE=${HOME}/BirdNET-Lite/IdentifiedSoFar.txt +IDFILE=${HOME}/Birding-Pi/IdentifiedSoFar.txt ## OVERLAP is the value in seconds which BirdNET should use when analyzing ## the data. The values must be between 0.0-2.9. @@ -444,7 +444,7 @@ EOF sudo ln -sf $(dirname ${my_dir})/birdnet.conf /etc/birdnet/birdnet.conf } -# Checks for a birdnet.conf file in the BirdNET-Lite directory for a +# Checks for a birdnet.conf file in the Birding-Pi directory for a # non-interactive installation. Otherwise,the installation is interactive. if [ -f ${BIRDNET_CONF} ];then source ${BIRDNET_CONF} diff --git a/scripts/install_services.sh b/scripts/install_services.sh index 9aaae79..99ce9f7 100755 --- a/scripts/install_services.sh +++ b/scripts/install_services.sh @@ -10,7 +10,7 @@ gotty_url="https://github.com/yudai/gotty/releases/download/v1.0.1/gotty_linux_a CONFIG_FILE="$(dirname ${my_dir})/birdnet.conf" install_scripts() { - echo "Installing BirdNET-Lite scripts to /usr/local/bin" + echo "Installing Birding-Pi scripts to /usr/local/bin" ln -sf ${my_dir}/* /usr/local/bin/ rm /usr/local/bin/index.html } @@ -207,7 +207,7 @@ ${EXTRACTIONS_URL} { php_fastcgi unix//run/php/php7.3-fpm.sock } -http://birdnetsystem.local { +http://birdingpi.local { root * ${EXTRACTED} file_server browse basicauth /Processed* { @@ -284,7 +284,7 @@ RestartSec=3 Type=simple User=${USER} Environment=TERM=xterm-256color -ExecStart=/usr/local/bin/gotty -p 8080 --title-format "BirdNET-Lite Log" journalctl -fu birdnet_analysis.service +ExecStart=/usr/local/bin/gotty -p 8080 --title-format "Birding-Pi Log" journalctl -fu birdnet_analysis.service [Install] WantedBy=multi-user.target @@ -318,7 +318,7 @@ RestartSec=3 Type=simple User=${USER} Environment=TERM=xterm-256color -ExecStart=/usr/local/bin/gotty -p 9090 --title-format "BirdNET-Lite Statistics" tmux new -A -s birdstats /usr/local/bin/birdnet_stats.sh +ExecStart=/usr/local/bin/gotty -p 9090 --title-format "Birding-Pi Statistics" tmux new -A -s birdstats /usr/local/bin/birdnet_stats.sh [Install] WantedBy=multi-user.target @@ -378,7 +378,7 @@ RestartSec=3 Type=simple User=pi Environment=TERM=xterm-256color -ExecStart=/usr/local/bin/gotty -w -p 9898 --title-format "Edit birdnet.conf" tmux new -A -s editbirdnet nano /home/pi/BirdNET-Lite/birdnet.conf +ExecStart=/usr/local/bin/gotty -w -p 9898 --title-format "Edit birdnet.conf" tmux new -A -s editbirdnet nano /home/pi/Birding-Pi/birdnet.conf [Install] WantedBy=multi-user.target @@ -418,7 +418,7 @@ install_livestream_service() { echo "Installing Live Stream service" cat << EOF > /etc/systemd/system/livestream.service [Unit] -Description=BirdNET-Lite Live Stream +Description=Birding-Pi Live Stream [Service] Environment=XDG_RUNTIME_DIR=/run/user/1000 diff --git a/scripts/install_tmux_services.sh b/scripts/install_tmux_services.sh index 30f470b..107e1a4 100755 --- a/scripts/install_tmux_services.sh +++ b/scripts/install_tmux_services.sh @@ -3,7 +3,7 @@ # ONLY run this additional script if you trust everyone on your # local network completely as the credentials are sent WITHOUT # any SSL/TLS encryption. For a secure remote connection to your -# BirdNET-Lite command line, consider enabling SSH on the +# Birding-Pi command line, consider enabling SSH on the # Raspberry Pi and using another Linux machine or an SSH # client software, or you can alternately add the 'tls internal' # directive to the Caddyfile to add a self-signed certificate for TLS/SSL @@ -46,7 +46,7 @@ install_tmux() { install_web_terminal() { cat << EOF | sudo tee /etc/systemd/system/birdterminal.service [Unit] -Description=A BirdNET-Lite Web Terminal +Description=A Birding-Pi Web Terminal [Service] Restart=on-failure diff --git a/scripts/reboot_system.php b/scripts/reboot_system.php index 2e385ad..7cb1023 100644 --- a/scripts/reboot_system.php +++ b/scripts/reboot_system.php @@ -1,4 +1,4 @@ diff --git a/scripts/reconfigure_birdnet.sh b/scripts/reconfigure_birdnet.sh index 7c46dfb..195d288 100755 --- a/scripts/reconfigure_birdnet.sh +++ b/scripts/reconfigure_birdnet.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash -# Reconfigure the BirdNET-Lite +# Reconfigure the Birding-Pi source /etc/birdnet/birdnet.conf uninstall.sh -${HOME}/BirdNET-Lite/scripts/install_config.sh -sudo ${HOME}/BirdNET-Lite/scripts/install_services.sh -echo "BirdNET-Lite has now been reconfigured." +${HOME}/Birding-Pi/scripts/install_config.sh +sudo ${HOME}/Birding-Pi/scripts/install_services.sh +echo "Birding-Pi has now been reconfigured." diff --git a/scripts/restart_birdnet_analysis.php b/scripts/restart_birdnet_analysis.php index 2c050a1..131bb36 100644 --- a/scripts/restart_birdnet_analysis.php +++ b/scripts/restart_birdnet_analysis.php @@ -1,4 +1,4 @@ diff --git a/scripts/restart_birdnet_recording.php b/scripts/restart_birdnet_recording.php index 9c61cd4..3b98615 100644 --- a/scripts/restart_birdnet_recording.php +++ b/scripts/restart_birdnet_recording.php @@ -1,4 +1,4 @@ diff --git a/scripts/restart_caddy.php b/scripts/restart_caddy.php index 3de0dd9..c50a923 100644 --- a/scripts/restart_caddy.php +++ b/scripts/restart_caddy.php @@ -1,4 +1,4 @@ diff --git a/scripts/restart_extraction.php b/scripts/restart_extraction.php index f847580..b663116 100644 --- a/scripts/restart_extraction.php +++ b/scripts/restart_extraction.php @@ -1,4 +1,4 @@ diff --git a/scripts/restart_services.php b/scripts/restart_services.php index 26329a4..9c83dfe 100644 --- a/scripts/restart_services.php +++ b/scripts/restart_services.php @@ -1,4 +1,4 @@ diff --git a/scripts/shutdown_system.php b/scripts/shutdown_system.php index b765831..2c9df23 100644 --- a/scripts/shutdown_system.php +++ b/scripts/shutdown_system.php @@ -1,4 +1,4 @@ diff --git a/scripts/spectrogram.php b/scripts/spectrogram.php index 3bf3804..1c66a42 100644 --- a/scripts/spectrogram.php +++ b/scripts/spectrogram.php @@ -1,4 +1,4 @@ diff --git a/scripts/spectrogram.sh b/scripts/spectrogram.sh index 8c15982..6ef0136 100755 --- a/scripts/spectrogram.sh +++ b/scripts/spectrogram.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # Make sox spectrogram source /etc/birdnet/birdnet.conf -analyzing_now="$(cat /home/pi/BirdNET-Lite/analyzing_now.txt)" +analyzing_now="$(cat /home/pi/Birding-Pi/analyzing_now.txt)" spectrogram_png=${EXTRACTED}/spectrogram.png sudo -u pi sox "${analyzing_now}" -n spectrogram -o "${spectrogram_png}" diff --git a/scripts/uninstall.sh b/scripts/uninstall.sh index 045699c..39bb210 100755 --- a/scripts/uninstall.sh +++ b/scripts/uninstall.sh @@ -105,5 +105,5 @@ remove_scripts() { remove_services remove_scripts if [ -d /etc/birdnet ];then sudo rm -drf /etc/birdnet;fi -if [ -f ${HOME}/BirdNET-Lite/birdnet.conf ];then sudo rm -f ${HOME}/BirdNET-Lite/birdnet.conf;fi +if [ -f ${HOME}/Birding-Pi/birdnet.conf ];then sudo rm -f ${HOME}/Birding-Pi/birdnet.conf;fi echo "Uninstall finished. Remove this directory with 'rm -drfv' to finish." diff --git a/templates/Caddyfile_livestream b/templates/Caddyfile_livestream index f2c2768..c9a553d 100644 --- a/templates/Caddyfile_livestream +++ b/templates/Caddyfile_livestream @@ -9,7 +9,7 @@ ${EXTRACTIONS_URL} { } reverse_proxy /stream localhost:8000 } -http://birdnetsystem.local { +http://birdingpi.local { root * ${EXTRACTED} file_server browse basicauth ${PROCESSED}* { diff --git a/templates/Caddyfile_nostream b/templates/Caddyfile_nostream index 05b3a77..396975c 100644 --- a/templates/Caddyfile_nostream +++ b/templates/Caddyfile_nostream @@ -8,7 +8,7 @@ ${EXTRACTIONS_URL} { birdnet ${HASHWORD} } } -http://birdnetsystem.local { +http://birdingpi.local { root * ${EXTRACTED} file_server browse basicauth ${PROCESSED}* { diff --git a/templates/cleanup.cron b/templates/cleanup.cron index f6002a0..38555fd 100644 --- a/templates/cleanup.cron +++ b/templates/cleanup.cron @@ -1,2 +1,3 @@ #birdnet 0 1 * * * /usr/local/bin/cleanup.sh &> /dev/null +@reboot /usr/local/bin/cleanup.sh &> /dev/null diff --git a/templates/livestream.service b/templates/livestream.service index 1c37350..2c7ac6d 100644 --- a/templates/livestream.service +++ b/templates/livestream.service @@ -1,5 +1,5 @@ [Unit] -Description=BirdNET-Lite Live Stream +Description=Birding-Pi Live Stream [Service] Environment=XDG_RUNTIME_DIR=/run/user/1000 Restart=always diff --git a/templates/tmux.conf b/templates/tmux.conf index 9af3364..f611760 100644 --- a/templates/tmux.conf +++ b/templates/tmux.conf @@ -11,12 +11,12 @@ set-window-option -g mode-keys vi set-option -g status-interval 5 set-option -g status 2 -set-option -g status-format[1] '#[bg=cyan,fg=black]#[align=left][BirdNET-Lite] #[bg=cyan]#[align=centre]#(vcgencmd measure_temp) #(vcgencmd get_throttled)#[align=right]#(~/BirdNET-Lite/scripts/disk_usage.sh)%l:%M%p' +set-option -g status-format[1] '#[bg=cyan,fg=black]#[align=left][Birding-Pi] #[bg=cyan]#[align=centre]#(vcgencmd measure_temp) #(vcgencmd get_throttled)#[align=right]#(~/Birding-Pi/scripts/disk_usage.sh)%l:%M%p' set-option -g status-style bg=magenta,fg=cyan set-option -g status-justify centre set-option -g status-left-length 50 set-option -g status-left '#[fg=brightyellow]arm clock #(vcgencmd measure_clock arm)' -set-option -g status-right '#[fg=brightyellow]%A, %B %e#(~/BirdNET-Lite/scripts/pretty_date.sh)' +set-option -g status-right '#[fg=brightyellow]%A, %B %e#(~/Birding-Pi/scripts/pretty_date.sh)' bind r source-file /etc/tmux.conf \; display "Reloaded!"