From 9ec6d89b08f12819a0723883d5f84476fd22f17c Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Tue, 29 Jan 2013 00:30:34 +0000 Subject: [PATCH] quick bug fix, no version changes, handling su return value for shell parent, weird stuff. Now will drill in until it hopefully gets su parent. --- inxi | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/inxi b/inxi index 653e558..955b7c0 100755 --- a/inxi +++ b/inxi @@ -6692,6 +6692,11 @@ get_shell_parent() script_parent=$( ps -fp $PPID --no-headers 2>/dev/null | awk '/'"$PPID"'/ { print $3 }' ) shell_parent=$( ps -p $script_parent --no-headers 2>/dev/null | awk '/'"$script_parent"'/ { print $NF}' ) + if [[ $shell_parent == 'su' ]];then + script_parent=$( ps -fp $script_parent --no-headers 2>/dev/null | awk '/'"$script_parent"'/ { print $3 }' ) + script_parent=$( ps -fp $script_parent --no-headers 2>/dev/null | awk '/'"$script_parent"'/ { print $3 }' ) + shell_parent=$( ps -p $script_parent --no-headers 2>/dev/null | awk '/'"$script_parent"'/ { print $NF}' ) + fi echo $shell_parent eval $LOGFE