From: Chris Koeritz Date: Wed, 29 Sep 2021 20:08:28 +0000 (-0400) Subject: added OLD_HOME variable pointing to HOME before sudo X-Git-Tag: 2.140.134~12^2~2 X-Git-Url: https://feistymeow.org/gitweb/?p=feisty_meow.git;a=commitdiff_plain;h=26afb709329d63e6d4aaf2cbae22bc80c9a11633 added OLD_HOME variable pointing to HOME before sudo makes it a bit easier to get back to the "real" user's home dir who started the sudo. --- diff --git a/scripts/core/functions.sh b/scripts/core/functions.sh index 8c9c0b2a..8ad72ccf 100644 --- a/scripts/core/functions.sh +++ b/scripts/core/functions.sh @@ -466,9 +466,9 @@ if [ -z "$skip_all" ]; then # launch sudo with just the variables we want to reach the other side. local varmods= -# varmods+="PATH= " + varmods+="OLD_HOME=$HOME " if [ ! -z "$IMPORTED_XAUTH" ]; then varmods+="IMPORTED_XAUTH=$IMPORTED_XAUTH "; fi - if [ ! -z "$SSH_AUTH_SOCK" ]; then varmods+="SSH_AUTH_SOCK=$SSH_AUTH_SOCK"; fi + if [ ! -z "$SSH_AUTH_SOCK" ]; then varmods+="SSH_AUTH_SOCK=$SSH_AUTH_SOCK "; fi /usr/bin/sudo $varmods "$@" retval=$?