diff --git a/inxi b/inxi index 13304e3..4f59c65 100755 --- a/inxi +++ b/inxi @@ -10,7 +10,8 @@ #### inxi, the universal, portable, system info script for irc. #### Tested with Irssi, Xchat, Konversation, BitchX, KSirc, ircII, #### Gaim/Pidgin, Weechat, KVIrc and Kopete. -#### Copyright (C) 2005-2007 locsmif +#### Original infobash author and copyright holder: +#### Copyright (C) 2005-2007 Michiel de Boer a.k.a. locsmif #### #### This program is free software; you can redistribute it and/or modify #### it under the terms of the GNU General Public License as published by @@ -74,10 +75,6 @@ OIFS="$IFS" # Backup the current Internal Field Seperator FL1='-' # These two determine separators in single line output, to force irc clients not to break off sections FL2='' -## Variable initializations: script parameter/option globals - - - ## Script names/paths SCRIPT_NAME="inxi" SCRIPT_PATH=$( dirname $0 ) @@ -120,7 +117,7 @@ NORMAL_BANS=( corporation communications technologies technology group $'\2'"\10)) + if ((!DEBUG_FLOOD && DBI > 10)) then error_handler 2 fi @@ -316,7 +313,7 @@ make_bans() # $1 = |<"none"> set_color_scheme() { - local i='' scriptColors='' colorCodes='' + local i='' script_colors='' color_codes='' if [[ $1 -ge ${#COLOR_SCHEMES[@]} ]] then @@ -325,20 +322,20 @@ set_color_scheme() SCHEME="$1" # Set a global variable to allow checking for chosen scheme later if ((IBSHELL)) then - colorCodes=($ANSI_COLORS) + color_codes=($ANSI_COLORS) else - colorCodes=($IRC_COLORS) + color_codes=($IRC_COLORS) fi for (( i=0; i < ${#COLORS_AVAILABLE[@]}; i++ )) do - eval "${COLORS_AVAILABLE[i]}=\"${colorCodes[i]}\"" + eval "${COLORS_AVAILABLE[i]}=\"${color_codes[i]}\"" done IFS="," - scriptColors=(${COLOR_SCHEMES[$1]}) + script_colors=(${COLOR_SCHEMES[$1]}) IFS="$OIFS" - C1="${!scriptColors[0]}" - C2="${!scriptColors[1]}" - CN="${!scriptColors[2]}" + C1="${!script_colors[0]}" + C2="${!script_colors[1]}" + CN="${!script_colors[2]}" ((CSCHEME++)) } @@ -584,34 +581,35 @@ get_start_source() set_calculated_variables() { - local i='' j='' + local path='' sys_path='' added_path='' + # Extra path variable to make execute failures less likely, merged below + local extra_paths="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" # Detect X and set variable "X" accordingly - if [[ $DISPLAY ]] + if [ -n "$DISPLAY" ] then X=1 fi # Fallback paths put into $EXTRA_PATH; This might, among others, help on gentoo. # Now, create a difference of $PATH and $EXTRA_PATH and add that to $PATH: - unset TPATH IFS=":" - for i in $EXTRA_PATH + for path in $extra_paths do FLAG=0 - for j in $PATH + for sys_path in $PATH do - if [[ $i = $j ]] + if [ "$path" == "$sys_path" ] then FLAG=1 fi done - if ! ((FLAG)) + if [ "$FLAG" -eq 0 ] then - TPATH="$TPATH:$i" + added_path="$added_path:$path" fi done IFS="$OIFS" - PATH="${PATH}${TPATH}" + PATH="${PATH}${added_path}" ##echo "PATH='$PATH'" ##/bin/sh -c 'echo "PATH in subshell=\"$PATH\""'