Fixed bug in bash method that fails in etch, old bash.

This commit is contained in:
inxi-svn 2008-11-09 08:26:06 +00:00
parent e513666122
commit e699488a94

26
inxi
View file

@ -601,18 +601,20 @@ get_start_client()
irc_client_path_lower=$( tr '[:upper:]' '[:lower:]' <<< $irc_client_path ) irc_client_path_lower=$( tr '[:upper:]' '[:lower:]' <<< $irc_client_path )
# from sidux infobash, handle bad detection of shell; Horst Tritremmel <hjt at sidux.com> # from sidux infobash, handle bad detection of shell; Horst Tritremmel <hjt at sidux.com>
# note: do NOT put into '' or "" the dash|bash\perl stuff, otherwise the structure fails # note: do NOT put into '' or "" the dash|bash\perl stuff, otherwise the structure fails
# handles the xchat/sh/bash/dash cases, and the konversation perl cases # handles the xchat/sh/bash/dash cases, and the konversation/perl cases, where
# handles the problem with konversation reporting itself as perl, which was missed because # konversation reports itself as perl, which was missed because when konversation starts inxi
# when konversation starts inxi from inside itself, as a script, the parent is konversation, not perl # from inside itself, as a script, the parent is konversation, not perl
if [[ ${irc_client_path_lower##*/} =~ dash|bash|sh|perl ]]; then ## note: this method: [[ ${irc_client_path_lower##*/} =~ dash|bash|sh|perl ]] fails in older bash, etch
# We want to know who wrapped it into the shell or perl. case ${irc_client_path_lower##*/} in
pppid="$( ps -p $PPID -o ppid --no-headers | sed 's/ //g' )" dash|bash|sh|perl) # We want to know who wrapped it into the shell or perl.
if [[ -n $pppid && -f /proc/$pppid/exe ]];then pppid="$( ps -p $PPID -o ppid --no-headers | sed 's/ //g' )"
irc_client_path="$( readlink /proc/$pppid/exe )" if [[ -n $pppid && -f /proc/$pppid/exe ]];then
irc_client_path_lower="$( tr '[:upper:]' '[:lower:]' <<< $irc_client_path )" irc_client_path="$( readlink /proc/$pppid/exe )"
b_non_native_app='true' irc_client_path_lower="$( tr '[:upper:]' '[:lower:]' <<< $irc_client_path )"
fi b_non_native_app='true'
fi fi
;;
esac
# replacing this fix with the one above, which is more globally affective # replacing this fix with the one above, which is more globally affective
# if [[ -z $( grep -i 'konversation' <<< $irc_client_path ) && -n $( grep -i 'perl' <<< $irc_client_path ) && -n $( pidof konversation ) ]];then # if [[ -z $( grep -i 'konversation' <<< $irc_client_path ) && -n $( grep -i 'perl' <<< $irc_client_path ) && -n $( pidof konversation ) ]];then
# irc_client_path=$( which konversation ) # irc_client_path=$( which konversation )