fix(common): restore output helpers after end_quiet_mode

After end_quiet_mode closes fd 3/4, the overridden warn/error/info
functions still reference >&3, causing "bad file descriptor" errors
for any calls after quiet mode ends (e.g. the reboot prompt).
Restore the original function definitions when leaving quiet mode.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
marvin.dietermann
2026-04-10 14:59:28 +02:00
parent 43247d4404
commit d1286329f8

View File

@@ -65,6 +65,15 @@ end_quiet_mode() {
exec 1>&3 2>&4 exec 1>&3 2>&4
exec 3>&- 4>&- exec 3>&- 4>&-
echo "" echo ""
# Restore original output helpers (fd 3/4 are closed now)
info() { echo -e "${GREEN}[✓]${NC} $1"; }
warn() { echo -e "${YELLOW}[!]${NC} $1"; }
error() {
echo -e "${RED}[✗]${NC} $1"
exit 1
}
step() { echo -e "\n${GREEN}━━━ $1 ━━━${NC}"; }
} }
# ── Config backup helper ───────────────────────────────────────── # ── Config backup helper ─────────────────────────────────────────