This commit is contained in:
2026-03-27 17:52:43 +00:00
parent f3abddddc2
commit 212faead11
+13 -5
View File
@@ -24,14 +24,22 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/../Master.conf"
source "$SCRIPT_DIR/../common.sh"
# ----------------------------- Input -----------------------------
DIRECTORY="$1"
# ----------------------------
# INPUT HANDLING (FIXED)
# ----------------------------
# If first argument is NOT a flag or VAR=VALUE, treat it as DIRECTORY
if [[ -z "$DIRECTORY" ]]; then
echo "Usage: $0 <directory-to-sync> [--dry-run] [VAR=value ...]"
if [[ "${1:-}" != "" && "${1:-}" != --* && "${1:-}" != *=* ]]; then
DIRECTORY="$1"
shift
fi
fi
if [[ -z "$DIRECTORY" ]]; then
echo "Usage: $0 <directory-to-sync> [--dry-run] [--status] [VAR=value ...]"
exit 1
fi
shift
parse_args "$@"
# ----------------------------- Host & IP -----------------------------
detect_hosts