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/../Master.conf"
|
||||||
source "$SCRIPT_DIR/../common.sh"
|
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
|
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
|
exit 1
|
||||||
fi
|
fi
|
||||||
shift
|
|
||||||
parse_args "$@"
|
|
||||||
|
|
||||||
# ----------------------------- Host & IP -----------------------------
|
# ----------------------------- Host & IP -----------------------------
|
||||||
detect_hosts
|
detect_hosts
|
||||||
|
|||||||
Reference in New Issue
Block a user