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 8f2893154..68e3d9477 100755 --- a/birdnet-pi/rootfs/etc/cont-init.d/99-run.sh +++ b/birdnet-pi/rootfs/etc/cont-init.d/99-run.sh @@ -2,32 +2,6 @@ # shellcheck shell=bash set -e -###################### -# CHECK BIRDNET.CONF # -###################### - -echo " " -bashio::log.info "Checking your birndet.conf file integrity" - -# Set variables -configcurrent="$HOME"/BirdNET-Pi/birdnet.conf -configtemplate="$HOME"/BirdNET-Pi/birdnet.bak - -# Extract variable names from config template and read each one -grep -o '^[^#=]*=' "$configtemplate" | sed 's/=//' | while read -r var; do - # Check if the variable is in configcurrent, if not, append it - if ! grep -q "^$var=" "$configcurrent"; then - # At which line was the variable in the initial file - bashio::log.yellow "...$var was missing from your birdnet.conf file, it was re-added" - grep "^$var=" "$configtemplate" >> "$configcurrent" - fi - # Check for duplicates - if [ "$(grep -c "^$var=" "$configcurrent")" -gt 1 ]; then - bashio::log.error "Duplicate variable $var found in $configcurrent, all were commented out expect for the first one" - awk -v var="$var" '{ if ($0 ~ "^[[:blank:]]*"var && c++ > 0) print "#" $0; else print $0; }' "$configcurrent" > temp && mv temp "$configcurrent" - fi -done - ############## # SET SYSTEM # ##############