audit echo vs log across all scripts — outcomes always visible, verbose for per-item loops
This commit is contained in:
@@ -110,13 +110,13 @@ if [[ "$ALL_MODE" == true ]]; then
|
||||
STOPPED_COUNT=$(echo "$STOPPED_IDS" | grep -c . || echo 0)
|
||||
|
||||
if [[ "$STOPPED_COUNT" -eq 0 ]]; then
|
||||
log "No stopped containers"
|
||||
echo "No stopped containers"
|
||||
elif [[ "$DRY_RUN" == true ]]; then
|
||||
warn "DRY RUN — would remove $STOPPED_COUNT stopped container(s):"
|
||||
docker ps -a --filter "status=exited" --filter "status=created" \
|
||||
--format " {{.Names}} {{.Image}} {{.Status}}" 2>/dev/null
|
||||
else
|
||||
log "Removing $STOPPED_COUNT stopped container(s)..."
|
||||
echo "Removing $STOPPED_COUNT stopped container(s)..."
|
||||
docker container prune -f 2>&1 | grep -v "^Total\|^$" || true
|
||||
success "Removed $STOPPED_COUNT stopped container(s)"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user