diff --git a/misc/core.func b/misc/core.func index 42207a5b..17bf5f9c 100644 --- a/misc/core.func +++ b/misc/core.func @@ -202,10 +202,8 @@ silent() { if [[ $rc -ne 0 ]]; then BASH_COMMAND="$cmd" - error_handler "$rc" + return $rc fi - - return $rc } # Function to download & save header files diff --git a/misc/error_handler.func b/misc/error_handler.func index d16a1a02..673927f4 100644 --- a/misc/error_handler.func +++ b/misc/error_handler.func @@ -81,11 +81,13 @@ explain_exit_code() { # === Error handler ============================================================ error_handler() { - local exit_code=$? + local exit_code=${1:-$?} local line_number=${BASH_LINENO[0]:-unknown} local command=${BASH_COMMAND:-unknown} - # Exitcode 0 = kein Fehler → ignorieren + # $STD im Kommando entfernen (nur kosmetisch) + command=${command//\$STD /} + if [[ "$exit_code" -eq 0 ]]; then return 0 fi @@ -107,6 +109,13 @@ error_handler() { } >>"$DEBUG_LOGFILE" fi + # Silent-Log + if [[ -n "${SILENT_LOGFILE:-}" && -s "$SILENT_LOGFILE" ]]; then + echo "--- Last 20 lines of silent log ($SILENT_LOGFILE) ---" + tail -n 20 "$SILENT_LOGFILE" + echo "---------------------------------------------------" + fi + exit "$exit_code" } diff --git a/misc/install.func b/misc/install.func index 1248c273..b27bfc01 100644 --- a/misc/install.func +++ b/misc/install.func @@ -2,8 +2,7 @@ # Author: tteck (tteckster) # Co-Author: MickLesk # Co-Author: michelroegl-brunner -# License: MIT -# https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE +# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE if ! command -v curl >/dev/null 2>&1; then printf "\r\e[2K%b" '\033[93m Setup Source \033[m' >&2