From eb820e995883837e0c055b1bb27917020c3ca01d Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Sat, 8 Nov 2008 20:39:27 +0000 Subject: [PATCH] Trying a sidux patch from infobash for the wrong output, shell instead of xchat etc --- inxi | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/inxi b/inxi index a4fbddb..0e084ec 100755 --- a/inxi +++ b/inxi @@ -1,7 +1,7 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 0.4.8 +#### version: 0.4.9 #### Date: November 8 2008 ######################################################################## #### inxi is a fork of infobash, the original bash sys info script by locsmif @@ -596,13 +596,20 @@ get_start_client() B_RUNNING_IN_SHELL='true' elif [[ -n $PPID && -f /proc/$PPID/exe ]];then irc_client_path=$( readlink /proc/$PPID/exe ) + irc_client_path_lower=$( tr '[:upper:]' '[:lower:]' <<< $irc_client_path ) # this handles the problem with konversation reporting itself as perl, which was missed because # when konversation starts inxi from inside itself, as a script, the parent is konversation, not perl if [[ -z $( grep -i 'konversation' <<< $irc_client_path ) && -n $( grep -i 'perl' <<< $irc_client_path ) && -n $( pidof konversation ) ]];then irc_client_path=$( which konversation ) non_native_konvi='true' + # from sidux infobash, handle bad detection of shell; Horst Tritremmel + elif [[ ${irc_client_path_lower##*/} =~ dash|bash|sh ]]; then + # We want to know who wrapped it into the shell. + PPPID="$( ps -p $PPID -o ppid --no-headers | sed 's/ //g' )" + if [[ -n $PPPID && -f /proc/$PPPID/exe ]];then + irc_client_path_lower="$( readlink /proc/$PPPID/exe | tr '[:upper:]' '[:lower:]' )" + fi fi - irc_client_path_lower=$( tr '[:upper:]' '[:lower:]' <<< $irc_client_path ) case $irc_client_path_lower in *irssi-text*|*irssi*)