From d1286329f81cd32c5c3a31cf8668c24febc0ba39 Mon Sep 17 00:00:00 2001 From: "marvin.dietermann" Date: Fri, 10 Apr 2026 14:59:28 +0200 Subject: [PATCH] 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 --- lib/common.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/common.sh b/lib/common.sh index ad00ba6..e53cd1e 100644 --- a/lib/common.sh +++ b/lib/common.sh @@ -65,6 +65,15 @@ end_quiet_mode() { exec 1>&3 2>&4 exec 3>&- 4>&- 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 ─────────────────────────────────────────