From 140404ff4984eebcab7dbaeee0e3645777e101bc Mon Sep 17 00:00:00 2001 From: David Kebler Date: Tue, 27 Feb 2024 19:37:44 -0800 Subject: [PATCH] fix sudo elevation --- install/install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install/install.sh b/install/install.sh index 38046c7..78ca920 100644 --- a/install/install.sh +++ b/install/install.sh @@ -7,10 +7,10 @@ uci_bash_shell_install () { # export BASH_SHELL_BASE="$(dirname "$(cd "$(dirname "${BASH_SOURCE:-$0}")" >/dev/null 2>&1 ; pwd -P )")" echo "Detected The UCI BASH Shell install directory: BASH_INSTALL_DIR=$install_dir" echo "Detected The UCI BASH Shell base directory: BASH_SHELL_BASE=$BASH_SHELL_BASE" - [[ $EUID -ne 0 ]] && usesudo="sudo -E" + [[ $EUID -ne 0 ]] && ( usesudo="sudo -E" && echo $USER elevated to sudo ) $usesudo $SHELL $install_dir/scripts/copy-etc.sh $usesudo $SHELL $install_dir/scripts/copy-root.sh - [[ $1 ]] && [[ $(id -u $1 2> /dev/null) ]] && $usesudo -E $SHELL $install_dir/scripts/copy-user.sh "$@" + [[ $1 ]] && [[ $(id -u $1 2> /dev/null) ]] && $usesudo $SHELL $install_dir/scripts/copy-user.sh "$@" } # # if script was executed then call the function