From 098dc845858ac3221056e72329592a5c45e98999 Mon Sep 17 00:00:00 2001 From: FailedProxy Date: Fri, 27 Mar 2026 18:50:59 +0000 Subject: [PATCH] fix --- Rsync/rsync.sh | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/Rsync/rsync.sh b/Rsync/rsync.sh index d2ace11..2111817 100644 --- a/Rsync/rsync.sh +++ b/Rsync/rsync.sh @@ -20,23 +20,11 @@ set -euo pipefail BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -# ----------------------------------------------------------------------------- -# Self-healing config loader (OPTION C) -# ----------------------------------------------------------------------------- -if [[ -f "$BASE_DIR/../common.sh" ]]; then - # normal layout: Rsync/ + shared root files - source "$BASE_DIR/../Master.conf" - source "$BASE_DIR/../common.sh" -elif [[ -f "$BASE_DIR/common.sh" ]]; then - # flat layout: everything inside Rsync/ - source "$BASE_DIR/Master.conf" - source "$BASE_DIR/common.sh" -else - echo "ℹ️ [INFO] Host: $(hostname)" - echo "❌ [ERROR] common.sh and Master.conf not found in expected locations" - echo "ℹ️ [INFO] BASE_DIR = $BASE_DIR" - exit 1 -fi +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +# Load configs & helpers +source "$SCRIPT_DIR/../Master.conf" +source "$SCRIPT_DIR/../common.sh" # ----------------------------------------------------------------------------- # Load shared helpers (if your common.sh provides these)