From 9e64d77f0e9f141a8b5766bbad19877282e60837 Mon Sep 17 00:00:00 2001 From: frederik Date: Sun, 19 Jan 2025 16:40:10 +0100 Subject: [PATCH] fix: update caddyfile after restore --- scripts/backup_data.sh | 1 + scripts/update_birdnet_snippets.sh | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/scripts/backup_data.sh b/scripts/backup_data.sh index dabc7bc..3391aa1 100755 --- a/scripts/backup_data.sh +++ b/scripts/backup_data.sh @@ -152,6 +152,7 @@ restore() { /home/$CURRENT_BIRDNET_USER/BirdNET-Pi/scripts/install_language_label.sh -l $DATABASE_LANG fi rm -fr ${UNPACK} + [ -n "${CADDY_PWD}" ] && sudo /usr/local/bin/update_caddyfile.sh > /dev/null 2>&1 log "Restore done" } diff --git a/scripts/update_birdnet_snippets.sh b/scripts/update_birdnet_snippets.sh index a6fef3b..4bbca58 100755 --- a/scripts/update_birdnet_snippets.sh +++ b/scripts/update_birdnet_snippets.sh @@ -188,6 +188,11 @@ if [ "$(grep -o "#birdnet" /etc/crontab | wc -l)" -lt 5 ]; then sed "s/\$USER/$USER/g" "$HOME"/BirdNET-Pi/templates/weekly_report.cron >> /etc/crontab fi +set +x +AUTH=$(grep basicauth /etc/caddy/Caddyfile) +[ -n "${CADDY_PWD}" ] && [ -z "${AUTH}" ] && sudo /usr/local/bin/update_caddyfile.sh > /dev/null 2>&1 +set -x + # update snippets above systemctl daemon-reload