Stable v1 framework

This commit is contained in:
2026-03-27 19:29:41 +00:00
parent 2e7f624e11
commit 0e1bb83ef1
2 changed files with 19 additions and 29 deletions
+8 -8
View File
@@ -23,7 +23,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/../Master.conf"
source "$SCRIPT_DIR/../common.sh"
# ----------------------------- ARG PARSING FIX -----------------------------
# ARG PARSING FIX
DIRECTORY=""
RAW_ARGS=()
@@ -42,11 +42,11 @@ parse_args "${RAW_ARGS[@]}"
[[ -z "$DIRECTORY" ]] && error "Missing directory" && exit 1
# ----------------------------- HOST -----------------------------
# HOST
detect_hosts
resolve_remote_ip
# ----------------------------- PROFILE -----------------------------
# PROFILE
PROFILE_NAME=$(basename "$DIRECTORY" | tr '[:upper:]' '[:lower:]')
MAX_RSYNC_PROCS=${PROFILE_MAX_PROCS[$PROFILE_NAME]:-$MAX_RSYNC_PROCS}
@@ -58,13 +58,13 @@ RETRY_COUNT=${PROFILE_RETRY_COUNT[$PROFILE_NAME]:-$RETRY_COUNT}
SLEEP=${PROFILE_SLEEP[$PROFILE_NAME]:-$SLEEP}
EXCLUDE_DIRS=(${PROFILE_EXCLUDE_DIRS[$PROFILE_NAME]:-${EXCLUDE_DIRS[@]}})
# ----------------------------- STATUS -----------------------------
# STATUS
if [[ "${SHOW_STATUS:-false}" == true ]]; then
show_status
exit 0
fi
# ----------------------------- HEADER -----------------------------
# HEADER
echo
echo "$ICON_RUN Sync Starting"
echo "Source: $DIRECTORY"
@@ -72,7 +72,7 @@ echo "Remote: $REMOTE_SERVER:$DIRECTORY"
echo "Profile: $PROFILE_NAME"
echo "Dry Run: $DRY_RUN"
# ----------------------------- REMOTE CHECK FIX -----------------------------
# REMOTE CHECK FIX
echo "$ICON_GEAR Checking remote..."
REMOTE_OK=false
@@ -92,7 +92,7 @@ if [[ "$REMOTE_OK" != true ]]; then
exit 1
fi
# ----------------------------- RSYNC LIMIT -----------------------------
# RSYNC LIMIT
wait_for_rsync() {
for i in $(seq 1 "$RETRY_COUNT"); do
COUNT=$(pgrep -fc "rsync.*root@${REMOTE_SERVER}" || true)
@@ -111,7 +111,7 @@ wait_for_rsync() {
wait_for_rsync
# ----------------------------- RUN -----------------------------
# RUN
stop_containers
get_rsync_opts