From 4e0c9007c3a34774346203f8b83f7fa1a1a6877d Mon Sep 17 00:00:00 2001 From: Terranom674 Date: Tue, 18 Aug 2026 16:10:17 +0200 Subject: [PATCH] Tombstone-Pfad pro NC-Verbindung aus Konfiguration bestimmen --- runtime/run-all.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/runtime/run-all.sh b/runtime/run-all.sh index 8a4b265..0bdd2bb 100644 --- a/runtime/run-all.sh +++ b/runtime/run-all.sh @@ -3,8 +3,6 @@ set -Eeuo pipefail CONFIG_DIR="/etc/bratonien-tools/nc-connector" SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" -PIWIGO_ROOT="${PIWIGO_ROOT:-/var/www/piwigo}" -TOMBSTONE_DIR="${PIWIGO_ROOT%/}/_data/bratonien-tools/nc-connector-status" shopt -s nullglob configs=("$CONFIG_DIR"/connection-*.conf) @@ -21,12 +19,21 @@ for config in "${configs[@]}"; do connection_id="${BASH_REMATCH[1]}" fi - if [[ -n "$connection_id" && -f "$TOMBSTONE_DIR/deleted-$connection_id" ]]; then + piwigo_root="$(sed -n 's/^PIWIGO_ROOT=//p' "$config" | tail -n 1)" + piwigo_root="${piwigo_root%\"}" + piwigo_root="${piwigo_root#\"}" + piwigo_root="${piwigo_root%\'}" + piwigo_root="${piwigo_root#\'}" + [[ -n "$piwigo_root" ]] || piwigo_root="/var/www/piwigo" + tombstone_dir="${piwigo_root%/}/_data/bratonien-tools/nc-connector-status" + + if [[ -n "$connection_id" && -f "$tombstone_dir/deleted-$connection_id" ]]; then echo "NC Connector: Verbindung $connection_id wurde geloescht; Laufzeitdateien werden entfernt." rm -f -- "$CONFIG_DIR/connection-$connection_id.conf" \ "$CONFIG_DIR/connection-$connection_id.db-password" \ "$CONFIG_DIR/connection-$connection_id.piwigo-password" \ "$CONFIG_DIR/connection-$connection_id.storages.tsv" + rm -f -- "$tombstone_dir/deleted-$connection_id" continue fi