diff --git a/inxi b/inxi index d88c141..14df422 100755 --- a/inxi +++ b/inxi @@ -1,7 +1,7 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 0.2.1 +#### version: 0.2.2 #### Date: October 30 2008 ######################################################################## #### inxi is a fork of infobash, the original bash sys info script by locsmif @@ -156,33 +156,36 @@ fi # Error handling error_handler() { + local error_message='' + case $1 in 2) - print_screen_output "$SCRIPT_NAME: large flood danger, debug buffer full!" + error_message="$SCRIPT_NAME: large flood danger, debug buffer full!" ;; 3) - print_screen_output "$SCRIPT_NAME: error in colorscheme - unsupported number: $2" + error_message="$SCRIPT_NAME: error in colorscheme - unsupported number: $2" ;; 4) - print_screen_output "$SCRIPT_NAME: unsupported verbosity level $2" + error_message="$SCRIPT_NAME: unsupported verbosity level $2" ;; 5) - print_screen_output "$SCRIPT_NAME: dependency not met: $2 not found in path" + error_message="$SCRIPT_NAME: dependency not met: $2 not found in path" ;; 6) - print_screen_output "$SCRIPT_NAME: /proc not found! Quitting..." + error_message="$SCRIPT_NAME: /proc not found! Quitting..." ;; 7) - print_screen_output "$SCRIPT_NAME: unknown parameter: $2" + error_message="$SCRIPT_NAME: unknown parameter: $2" ;; 8) - print_screen_output "$SCRIPT_NAME: the self-updater failed, wget exited with error: $2. You probably need to be root." + error_message="$SCRIPT_NAME: the self-updater failed, wget exited with error: $2.\nYou probably need to be root.\nHint, to make for easy updates without being root, do: chown $SCRIPT_NAME" ;; *) - print_screen_output "$SCRIPT_NAME: error unknown: $@" + error_message="$SCRIPT_NAME: error unknown: $@" set -- 99 ;; esac + print_screen_output "$error_message" exit $1 }