From 6924a16369eadd0967f1eb174565d6927b952c54 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Mon, 3 Jun 2024 11:38:12 +0200 Subject: [PATCH] if bashio::config.true "SPECIES_CONVERTER"; then --- .../rootfs/etc/cont-init.d/71-newfeatures.sh | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/birdnet-pi/rootfs/etc/cont-init.d/71-newfeatures.sh b/birdnet-pi/rootfs/etc/cont-init.d/71-newfeatures.sh index 71ba1f9dd..94ecab8fd 100755 --- a/birdnet-pi/rootfs/etc/cont-init.d/71-newfeatures.sh +++ b/birdnet-pi/rootfs/etc/cont-init.d/71-newfeatures.sh @@ -10,6 +10,7 @@ echo " " bashio::log.info "Adding new features" # Add dark mode +############### if [ ! -f "$HOME"/BirdNET-Pi/homepage/static/dark-style.css ]; then echo "... enabling the dark mode option" if [ -f /config/birdnet.conf ] && ! grep -q "COLOR_SCHEME" /config/birdnet.conf; then echo "COLOR_SCHEME=light" >> /config/birdnet.conf; fi @@ -21,10 +22,21 @@ if [ ! -f "$HOME"/BirdNET-Pi/homepage/static/dark-style.css ]; then done fi + +# Enable the Processed folder +############################# +if ! grep -q "Processed_Files" "$HOME"/BirdNET-Pi/scripts/birdnet_analysis.py; then + echo "... Enabling the Processed folder : the last 15 wav files will be stored there" + rm /home/"$USER"/BirdNET-Pi/scripts/birdnet_analysis.py + curl -o /home/"$USER"/BirdNET-Pi/scripts/birdnet_analysis.py https://raw.githubusercontent.com/alexbelgium/BirdNET-Pi/patch-1_processed_restore/scripts/birdnet_analysis.py + chown "$USER:$USER" /home/"$USER"/BirdNET-Pi/scripts/birdnet_analysis.py + chmod 777 /home/"$USER"/BirdNET-Pi/scripts/birdnet_analysis.py +fi + # Add species conversion system ############################### -if ! grep -q "Converted" "$HOME"/BirdNET-Pi/homepage/views.php; then +if bashio::config.true "SPECIES_CONVERTER"; then echo "... adding feature of SPECIES_CONVERTER, a new tab is added to your Tools" touch /config/convert_species_list.txt chown pi:pi /config/convert_species_list.txt @@ -86,15 +98,4 @@ if ! grep -q "Converted" "$HOME"/BirdNET-Pi/homepage/views.php; then fi fi -exit 0 - -# Enable the Processed folder -if ! grep -q "Processed_Files" "$HOME"/BirdNET-Pi/scripts/birdnet_analysis.py; then - echo "... Enabling the Processed folder : the last 15 wav files will be stored there" - rm /home/"$USER"/BirdNET-Pi/scripts/birdnet_analysis.py - curl -o /home/"$USER"/BirdNET-Pi/scripts/birdnet_analysis.py https://raw.githubusercontent.com/alexbelgium/BirdNET-Pi/patch-1_processed_restore/scripts/birdnet_analysis.py - chown "$USER:$USER" /home/"$USER"/BirdNET-Pi/scripts/birdnet_analysis.py - chmod 777 /home/"$USER"/BirdNET-Pi/scripts/birdnet_analysis.py -fi - echo " "