mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
added a comment to explain the hack for su/process grandparent
This commit is contained in:
parent
9ec6d89b08
commit
9515a5ab00
1
inxi
1
inxi
|
@ -6692,6 +6692,7 @@ get_shell_parent()
|
||||||
|
|
||||||
script_parent=$( ps -fp $PPID --no-headers 2>/dev/null | awk '/'"$PPID"'/ { print $3 }' )
|
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}' )
|
shell_parent=$( ps -p $script_parent --no-headers 2>/dev/null | awk '/'"$script_parent"'/ { print $NF}' )
|
||||||
|
# no idea why have to do script_parent action twice in su case, but you do, oh well.
|
||||||
if [[ $shell_parent == 'su' ]];then
|
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 }' )
|
||||||
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 }' )
|
||||||
|
|
Loading…
Reference in a new issue