fuck
This commit is contained in:
+13
-5
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user