improved progress more

This commit is contained in:
2026-03-27 20:46:16 +00:00
parent 71add4ad71
commit 71e4c95965
+11 -7
View File
@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# ----------------------------------------------------------------------------------------------- # -----------------------------------------------------------------------------------------------
# ----------------- UNRAID OPS COMMON LIBRARY (FINAL STABLE FRAMEWORK v1) ----------------------- # ----------------- UNRAID OPS COMMON LIBRARY (FINAL STABLE FRAMEWORK v2) -----------------------
# ----------------------------------------------------------------------------------------------- # -----------------------------------------------------------------------------------------------
# ----------------------------- ICONS ----------------------------- # ----------------------------- ICONS -----------------------------
@@ -10,9 +10,7 @@ ICON_ERROR="❌"
ICON_SUCCESS="✅" ICON_SUCCESS="✅"
ICON_RUN="🚀" ICON_RUN="🚀"
ICON_STOP="🛑" ICON_STOP="🛑"
ICON_RETRY="🔁"
ICON_SYNC="🔄" ICON_SYNC="🔄"
ICON_GEAR="⚙️"
# ----------------------------- OUTPUT ----------------------------- # ----------------------------- OUTPUT -----------------------------
info() { echo "$ICON_INFO [INFO] $*"; } info() { echo "$ICON_INFO [INFO] $*"; }
@@ -120,6 +118,7 @@ stop_containers() {
RUNNING_CONTAINERS=() RUNNING_CONTAINERS=()
for c in "${CRITICAL_CONTAINER_NAMES[@]}"; do for c in "${CRITICAL_CONTAINER_NAMES[@]}"; do
log "Checking container: $c"
STATUS=$(ssh -i "$SSH_KEY" root@"$REMOTE_SERVER" \ STATUS=$(ssh -i "$SSH_KEY" root@"$REMOTE_SERVER" \
"docker inspect -f '{{.State.Running}}' $c 2>/dev/null" || echo "false") "docker inspect -f '{{.State.Running}}' $c 2>/dev/null" || echo "false")
@@ -192,10 +191,15 @@ get_rsync_opts() {
log "Using default rsync opts" log "Using default rsync opts"
fi fi
# ------------------ PROGRESS (SAFE TOGGLE) ------------------ # ------------------ CLEAN PROGRESS OUTPUT ------------------
if [[ "${ENABLE_PROGRESS:-false}" == true ]]; then if [[ "${ENABLE_PROGRESS:-false}" == true ]]; then
RSYNC_OPTS+=(--info=progress2 --human-readable --no-inc-recursive) RSYNC_OPTS+=(
log "Progress enabled (progress2 + human-readable)" --info=progress2
--human-readable
--no-inc-recursive
--info=name0
)
log "Progress enabled (clean mode)"
fi fi
} }
@@ -208,6 +212,6 @@ show_status() {
echo "Profile: $PROFILE_NAME" echo "Profile: $PROFILE_NAME"
echo "DryRun: $DRY_RUN" echo "DryRun: $DRY_RUN"
echo "Logging: $ENABLE_LOGGING" echo "Logging: $ENABLE_LOGGING"
echo "Progress:${ENABLE_PROGRESS:-false}" echo "Progress: ${ENABLE_PROGRESS:-false}"
echo "==================" echo "=================="
} }