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