Fixed some more weaknesses with the client detection function.

This commit is contained in:
inxi-svn 2008-11-09 08:57:27 +00:00
parent e699488a94
commit b1fa122748

11
inxi
View file

@ -593,7 +593,7 @@ get_start_client()
local b_non_native_app='false' pppid='' local b_non_native_app='false' pppid=''
if tty >/dev/null;then if tty >/dev/null;then
IRC_CLIENT="Shell" IRC_CLIENT='Shell'
unset IRC_CLIENT_VERSION unset IRC_CLIENT_VERSION
B_RUNNING_IN_SHELL='true' B_RUNNING_IN_SHELL='true'
elif [[ -n $PPID && -f /proc/$PPID/exe ]];then elif [[ -n $PPID && -f /proc/$PPID/exe ]];then
@ -606,7 +606,7 @@ get_start_client()
# from inside itself, as a script, the parent is konversation, not perl # from inside itself, as a script, the parent is konversation, not perl
## note: this method: [[ ${irc_client_path_lower##*/} =~ dash|bash|sh|perl ]] fails in older bash, etch ## note: this method: [[ ${irc_client_path_lower##*/} =~ dash|bash|sh|perl ]] fails in older bash, etch
case ${irc_client_path_lower##*/} in case ${irc_client_path_lower##*/} in
dash|bash|sh|perl) # We want to know who wrapped it into the shell or perl. bash|dash|sh|perl) # We want to know who wrapped it into the shell or perl.
pppid="$( ps -p $PPID -o ppid --no-headers | sed 's/ //g' )" pppid="$( ps -p $PPID -o ppid --no-headers | sed 's/ //g' )"
if [[ -n $pppid && -f /proc/$pppid/exe ]];then if [[ -n $pppid && -f /proc/$pppid/exe ]];then
irc_client_path="$( readlink /proc/$pppid/exe )" irc_client_path="$( readlink /proc/$pppid/exe )"
@ -735,8 +735,9 @@ get_start_client()
}' )" }' )"
IRC_CLIENT="Kopete" IRC_CLIENT="Kopete"
;; ;;
*perl*) *perl*|*ksirc*|*dsirc*)
unset IRC_CLIENT_VERSION # KSirc is one of the possibilities now. KSirc is a wrapper around dsirc, a perl client unset IRC_CLIENT_VERSION
# KSirc is one of the possibilities now. KSirc is a wrapper around dsirc, a perl client
get_cmdline $PPID get_cmdline $PPID
for (( i=0; i <= $CMDL_MAX; i++ )) for (( i=0; i <= $CMDL_MAX; i++ ))
do do
@ -764,7 +765,7 @@ get_start_client()
IRC_CLIENT="Unknown Perl client" IRC_CLIENT="Unknown Perl client"
fi fi
;; ;;
*bash*|*sh*) *bash*|*dash*|*sh*)
unset IRC_CLIENT_VERSION unset IRC_CLIENT_VERSION
IRC_CLIENT="Shell wrapper" IRC_CLIENT="Shell wrapper"
;; ;;