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 4e0c100ae..679efcf01 100755 --- a/birdnet-pi/rootfs/etc/cont-init.d/99-run.sh +++ b/birdnet-pi/rootfs/etc/cont-init.d/99-run.sh @@ -80,13 +80,16 @@ 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 -# Correct allaboutbirds for non-english names -echo "... allow allaboutbirds for non-english names" -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 -sed -i 's|allaboutbirds.org/guide/|https://ebird.org/species/?siteLanguage=DATABASE_LANG_$DATABASE_LANG|g" "$HOME"/BirdNET-Pi/scripts/todays_detections.php +# Set the online birds info system +if [[ "$(bashio::config "BIRDS_ONLINE_INFO")" == *"ebird"* ]]; then + echo "... using ebird instead of allaboutbirds" + 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 + sed -i "s|https://allaboutbirds.org/guide/|https://ebird.org/species/?siteLanguage=DATABASE_LANG_$DATABASE_LANG|g" "$HOME"/BirdNET-Pi/scripts/todays_detections.php +else + # Correct allaboutbirds for non-english names + echo "... using allaboutbirds, with correction for non-english names" + 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 + sed -i 's|allaboutbirds.org/guide/