This commit is contained in:
2026-03-24 20:40:05 +00:00
parent d703d7e153
commit 6c6d510fde
2 changed files with 37 additions and 21 deletions
+6 -11
View File
@@ -10,28 +10,23 @@ source "$SCRIPT_DIR/../common.sh"
# Load config
load_master_conf
# Parse arguments, etc...
# Detect hosts and SSH key
detect_hosts
#-----------------------------------------------------------------------------------------------
# --------------------------- Input Arguments --------------------------------------------------
#-----------------------------------------------------------------------------------------------
# Input arguments
DIRECTORY="$1"
if [[ -z "$DIRECTORY" ]]; then
echo "Usage: $0 <directory-to-sync> [--dry-run|-n] [VAR=value ...]"
exit 1
fi
shift # remove DIRECTORY
# Parse CLI args
shift
parse_args "$@"
#-----------------------------------------------------------------------------------------------
# --------------------------- Profile Detection -------------------------------------------------
#-----------------------------------------------------------------------------------------------
# Determine profile
PROFILE_NAME=$(basename "$DIRECTORY" | tr '[:upper:]' '[:lower:]')
echo "Detected profile: $PROFILE_NAME"
# Apply profile defaults or fallback to global defaults
# Apply profile settings
MAX_RSYNC_PROCS=${PROFILE_MAX_PROCS[$PROFILE_NAME]:-$MAX_RSYNC_PROCS}
BW_LIMIT=${PROFILE_BW_LIMIT[$PROFILE_NAME]:-$BW_LIMIT}
CRITICAL_CONTAINER_NAMES=(${PROFILE_CRITICAL_CONTAINER_NAMES[$PROFILE_NAME]})