diff --git a/Rsync/rsync.sh b/Rsync/rsync.sh index b03e657..74a161c 100644 --- a/Rsync/rsync.sh +++ b/Rsync/rsync.sh @@ -4,13 +4,13 @@ set -e #----------------------------------------------------------------------------------------------- # --------------------------- Core Rsync Script for Unraid ------------------------------------- #----------------------------------------------------------------------------------------------- - SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" source "$SCRIPT_DIR/../common.sh" -# Load Master.conf and detect remote server +# Load config load_master_conf -detect_remote + +# Parse arguments, etc... #----------------------------------------------------------------------------------------------- # --------------------------- Input Arguments -------------------------------------------------- diff --git a/common.sh b/common.sh index 1d5a24f..e6e9b9d 100644 --- a/common.sh +++ b/common.sh @@ -13,9 +13,13 @@ #----------------------------------------------------------------------------------------------- # Load Master.conf load_master_conf() { + # Resolve the folder of the calling script (rsync.sh) local script_dir script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + + # Master.conf is one level up from Rsync/ local master_conf="$script_dir/../Master.conf" + if [ -f "$master_conf" ]; then source "$master_conf" echo "Loaded Master.conf from $master_conf"