echo fix in common.sh
This commit is contained in:
@@ -138,13 +138,13 @@ stop_containers() {
|
||||
for c in "${CRITICAL_CONTAINER_NAMES[@]}"; do
|
||||
[[ -z "$c" ]] && continue
|
||||
|
||||
log "Checking container: $c"
|
||||
info "Checking $c..."
|
||||
|
||||
STATUS=$(ssh -i "$SSH_KEY" root@"$REMOTE_SERVER" \
|
||||
"docker inspect -f '{{.State.Running}}' $c 2>/dev/null" 2>/dev/null || echo "false")
|
||||
|
||||
if [[ "$STATUS" == "true" ]]; then
|
||||
warn "$ICON_STOP Stopping $c"
|
||||
echo "$ICON_STOP Stopping $c..."
|
||||
RUNNING_CONTAINERS+=("$c")
|
||||
|
||||
if ssh -i "$SSH_KEY" root@"$REMOTE_SERVER" "docker stop $c" >/dev/null; then
|
||||
@@ -153,7 +153,7 @@ stop_containers() {
|
||||
error "Failed to stop $c"
|
||||
fi
|
||||
else
|
||||
log "$c already stopped or not found"
|
||||
warn "$c is not running, skipping"
|
||||
fi
|
||||
done
|
||||
}
|
||||
@@ -169,7 +169,6 @@ start_containers() {
|
||||
for c in "${RUNNING_CONTAINERS[@]}"; do
|
||||
[[ -z "$c" ]] && continue
|
||||
|
||||
# Check if this container needs a delay before starting
|
||||
local needs_delay=false
|
||||
for d in "${DELAYED_CONTAINERS[@]}"; do
|
||||
if [[ "$c" == "$d" ]]; then
|
||||
@@ -179,11 +178,11 @@ start_containers() {
|
||||
done
|
||||
|
||||
if [[ "$needs_delay" == true ]]; then
|
||||
info "Delaying start of $c by ${CONTAINER_DELAY}s..."
|
||||
info "Waiting ${CONTAINER_DELAY}s before starting $c..."
|
||||
sleep "$CONTAINER_DELAY"
|
||||
fi
|
||||
|
||||
info "Starting $c"
|
||||
echo "$ICON_RUN Starting $c..."
|
||||
if ssh -i "$SSH_KEY" root@"$REMOTE_SERVER" "docker start $c" >/dev/null; then
|
||||
success "$c started"
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user