Add --seed flag to rsync.sh to skip empty-remote-share guard on first push

This commit is contained in:
Gmer4Lfe
2026-06-14 14:39:23 -04:00
parent 6525b957c6
commit 3c880b5bda
+6 -1
View File
@@ -128,6 +128,9 @@
# rsync.sh /path/to/share --log # rsync.sh /path/to/share --log
# Verbose output throughout — every decision logged. # Verbose output throughout — every decision logged.
# #
# rsync.sh /path/to/share --seed
# Skip the empty-remote-share guard. Use for first-time seeding of a new share.
#
# ============================================================================================== # ==============================================================================================
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
@@ -137,11 +140,13 @@ source "$SCRIPT_DIR/../load_config.sh"
# ── Separate positional directory arg from flags ─────────────────────────────────────────────── # ── Separate positional directory arg from flags ───────────────────────────────────────────────
DIRECTORY="" DIRECTORY=""
PROFILE_OVERRIDE="" PROFILE_OVERRIDE=""
SEED=false
RAW_ARGS=() RAW_ARGS=()
for ARG in "$@"; do for ARG in "$@"; do
case "$ARG" in case "$ARG" in
--profile=*) PROFILE_OVERRIDE="${ARG#--profile=}" ;; --profile=*) PROFILE_OVERRIDE="${ARG#--profile=}" ;;
--seed) SEED=true ;;
--*|*=*) RAW_ARGS+=("$ARG") ;; --*|*=*) RAW_ARGS+=("$ARG") ;;
*) [[ -z "$DIRECTORY" ]] && DIRECTORY="$ARG" || RAW_ARGS+=("$ARG") ;; *) [[ -z "$DIRECTORY" ]] && DIRECTORY="$ARG" || RAW_ARGS+=("$ARG") ;;
esac esac
@@ -252,7 +257,7 @@ check_os_version_parity || exit 1
check_connectivity check_connectivity
check_remote_rootfs check_remote_rootfs
check_remote_share "$DIRECTORY" [[ "$SEED" == false ]] && check_remote_share "$DIRECTORY"
check_remote_disks "$DIRECTORY" check_remote_disks "$DIRECTORY"
# Remote Docker daemon — check before attempting container operations # Remote Docker daemon — check before attempting container operations