don't run profile startup script if user is logged in via su command

master
David Kebler 2020-11-29 09:24:51 -08:00
parent ffecdd9501
commit ff1d4c11be
1 changed files with 2 additions and 1 deletions

View File

@ -1,5 +1,6 @@
# this runs startups for bash shell base system # this runs startups for bash shell base system
if [ "$SHELL" = "/bin/bash" ] && [ "${BASH_SHELL_STARTUP}" ]; then # don't run statup if user logs in via su
if [ "$SHELL" = "/bin/bash" ] && [ "${BASH_SHELL_STARTUP}" ] && [ "$(ps -o comm= $PPID)" != "su" ]; then
# uncomment for debugging # uncomment for debugging
if [[ -f $BASH_SHELL_STARTUP ]] && [[ $EUID -ne 0 ]]; then if [[ -f $BASH_SHELL_STARTUP ]] && [[ $EUID -ne 0 ]]; then
llog "running startup script $BASH_SHELL_STARTUP async" llog "running startup script $BASH_SHELL_STARTUP async"