mirror of
https://github.com/smxi/inxi.git
synced 2025-01-19 08:57:57 +00:00
Fixed bug in bash method that fails in etch, old bash.
This commit is contained in:
parent
e513666122
commit
e699488a94
14
inxi
14
inxi
|
@ -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
|
||||||
|
dash|bash|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 )"
|
||||||
irc_client_path_lower="$( tr '[:upper:]' '[:lower:]' <<< $irc_client_path )"
|
irc_client_path_lower="$( tr '[:upper:]' '[:lower:]' <<< $irc_client_path )"
|
||||||
b_non_native_app='true'
|
b_non_native_app='true'
|
||||||
fi
|
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 )
|
||||||
|
|
Loading…
Reference in a new issue