U
This commit is contained in:
+6
-9
@@ -6,25 +6,21 @@ source "$SCRIPT_DIR/../common.sh"
|
||||
|
||||
# Load config
|
||||
load_master_conf
|
||||
detect_hosts
|
||||
parse_args "$@"
|
||||
|
||||
# Input directory
|
||||
DIRECTORY="$1"
|
||||
if [[ -z "$DIRECTORY" ]]; then
|
||||
echo "Usage: $0 <directory-to-sync> [--dry-run|-n] [VAR=value ...]"
|
||||
exit 1
|
||||
fi
|
||||
shift
|
||||
parse_args "$@"
|
||||
|
||||
# Detect hosts & SSH key
|
||||
detect_hosts
|
||||
|
||||
# Determine profile
|
||||
DIR_CLEAN="${DIRECTORY%/}"
|
||||
PROFILE_NAME=$(basename "$DIR_CLEAN" | tr '[:upper:]' '[:lower:]')
|
||||
# Determine profile from folder basename
|
||||
PROFILE_NAME=$(basename "$DIRECTORY" | tr '[:upper:]' '[:lower:]')
|
||||
echo "Detected profile: $PROFILE_NAME"
|
||||
|
||||
# Apply profile 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]})
|
||||
@@ -34,6 +30,7 @@ RETRY_COUNT=${PROFILE_RETRY_COUNT[$PROFILE_NAME]:-$RETRY_COUNT}
|
||||
SLEEP=${PROFILE_SLEEP[$PROFILE_NAME]:-$SLEEP}
|
||||
EXCLUDE_DIRS=(${PROFILE_EXCLUDE_DIRS[$PROFILE_NAME]:-${EXCLUDE_DIRS[@]}})
|
||||
|
||||
|
||||
# Validate
|
||||
validate_int MAX_RSYNC_PROCS "$MAX_RSYNC_PROCS"
|
||||
validate_int BW_LIMIT "$BW_LIMIT"
|
||||
|
||||
Reference in New Issue
Block a user