Improve installer error handling

This commit is contained in:
dbildhauer committed 2026-09-27 19:45:01 +02:00
1 parent 2251a98eeb
commit b66438d5d4
1 file changed
+22 -6
+22 -6
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
set -e
set -Eeuo pipefail
PROJECT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
@@ -10,17 +10,33 @@ echo " Debian 13 XFCE Admin Workstation Installer"
echo "=============================================="
echo
for script in "$PROJECT_DIR"/install/*.sh
do
FAILED=()
chmod +x "$PROJECT_DIR"/install/*.sh
for script in "$PROJECT_DIR"/install/*.sh; do
echo
echo "=============================================="
echo "==> $(basename "$script")"
echo "=============================================="
bash "$script"
if bash "$script"; then
echo "✔ $(basename "$script") erfolgreich."
else
echo "✘ Fehler in $(basename "$script")"
FAILED+=("$(basename "$script")")
fi
done
echo
echo "=============================================="
echo " Installation abgeschlossen!"
echo " Bitte einmal neu starten."
if [ ${#FAILED[@]} -eq 0 ]; then
echo "Installation erfolgreich abgeschlossen."
else
echo "Folgende Skripte sind fehlgeschlagen:"
printf ' - %s\n' "${FAILED[@]}"
exit 1
fi
echo "=============================================="