From 19e7b247e81d4558714bb0a81bc1e20240965254 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Mon, 29 Apr 2024 19:26:38 +0200 Subject: [PATCH] Update 99-run.sh --- birdnet-pi/rootfs/etc/cont-init.d/99-run.sh | 44 --------------------- 1 file changed, 44 deletions(-) diff --git a/birdnet-pi/rootfs/etc/cont-init.d/99-run.sh b/birdnet-pi/rootfs/etc/cont-init.d/99-run.sh index 68e3d9477..e98fa176d 100755 --- a/birdnet-pi/rootfs/etc/cont-init.d/99-run.sh +++ b/birdnet-pi/rootfs/etc/cont-init.d/99-run.sh @@ -42,48 +42,4 @@ bashio::log.info "Starting BirdNET-Pi services" chmod +x "$HOME"/BirdNET-Pi/scripts/restart_services.sh /."$HOME"/BirdNET-Pi/scripts/restart_services.sh &>/proc/1/fd/1 -################ -# MODIFY WEBUI # -################ - -echo " " -bashio::log.info "Adapting webui" - -# Remove services tab -echo "... removing System Controls from webui as should be used from HA" -sed -i '/>System Controls/d' "$HOME"/BirdNET-Pi/homepage/views.php - -# Remove services tab -echo "... removing Ram drive from webui as it is handled from HA" -sed -i '/Ram drive/{n;s/center"/center" style="display: none;"/;}' "$HOME"/BirdNET-Pi/scripts/service_controls.php -sed -i '/Ram drive/d' "$HOME"/BirdNET-Pi/scripts/service_controls.php - -# Correct the phpsysinfo for the correct gotty service -gottyservice="$(pgrep -l "gotty" | awk '{print $NF}' | head -n 1)" -echo "... using $gottyservice in phpsysinfo" -sed -i "s/,gotty,/,${gottyservice:-gotty},/g" "$HOME"/BirdNET-Pi/templates/phpsysinfo.ini - -# Set the online birds info system -if [[ "$(bashio::config "BIRDS_ONLINE_INFO")" == *"ebird"* ]]; then - echo "... using ebird instead of allaboutbirds" - mv /ebird.txt /home/pi/BirdNET-Pi/model/ebird.txt - chown pi:pi /home/pi/BirdNET-Pi/model/ebird.txt - # shellcheck disable=SC2016 - sed -i '/$sciname =/a \\t$ebirdname = shell_exec("grep \\"$( echo \\"$sciname\\" | sed '\''s/_/ /g'\'')\\" /home/pi/BirdNET-Pi/model/ebird.txt | cut -d'\''_'\'' -f2 | sed '\''s/ /_/g'\''");' "$HOME"/BirdNET-Pi/scripts/todays_detections.php - # shellcheck disable=SC2016 - sed -i '/$sciname =/a \\t$ebirdname = shell_exec("grep \\"$( echo \\"$sciname\\" | sed '\''s/_/ /g'\'')\\" /home/pi/BirdNET-Pi/model/ebird.txt | cut -d'\''_'\'' -f2 | sed '\''s/ /_/g'\''");' "$HOME"/BirdNET-Pi/scripts/stats.php - sed -i "s|https://allaboutbirds.org/guide/|https://ebird.org/species/?siteLanguage=${DATABASE_LANG}_${DATABASE_LANG}|g" "$HOME"/BirdNET-Pi/scripts/todays_detections.php - sed -i "s|https://allaboutbirds.org/guide/\$comname|https://ebird.org/species/\$ebirdname?siteLanguage=${DATABASE_LANG}_${DATABASE_LANG}|g" "$HOME"/BirdNET-Pi/scripts/stats.php -else - # Correct allaboutbirds for non-english names - echo "... using allaboutbirds, with correction for non-english names" - # shellcheck disable=SC2016 - sed -i '/$sciname =/a \\t$comnameen = shell_exec("grep \\"$( echo \\"$sciname\\" | sed '\''s/_/ /g'\'')\\" /home/pi/BirdNET-Pi/model/labels.bak | cut -d'\''_'\'' -f2 | sed '\''s/ /_/g'\''");' "$HOME"/BirdNET-Pi/scripts/todays_detections.php - # shellcheck disable=SC2016 - sed -i '/$sciname =/a \\t$comnameen = shell_exec("grep \\"$( echo \\"$sciname\\" | sed '\''s/_/ /g'\'')\\" /home/pi/BirdNET-Pi/model/labels.bak | cut -d'\''_'\'' -f2 | sed '\''s/ /_/g'\''");' "$HOME"/BirdNET-Pi/scripts/stats.php - # shellcheck disable=SC2016 - sed -i 's|allaboutbirds.org/guide/