mirror of
https://github.com/fsquillace/junest.git
synced 2026-07-28 05:24:11 +00:00
Use SUDO_USER instead of SUDO_UID
This commit is contained in:
parent
59d71111b1
commit
2cae586c34
1 changed files with 2 additions and 1 deletions
|
|
@ -192,7 +192,8 @@ function setup_env_from_file(){
|
|||
|
||||
function run_env_as_root(){
|
||||
local uid=$UID
|
||||
[ -z $SUDO_UID ] || uid=$SUDO_UID:$SUDO_GID
|
||||
# SUDO_USER is more reliable compared to SUDO_UID
|
||||
[ -z $SUDO_USER ] || uid=$SUDO_USER:$SUDO_GID
|
||||
|
||||
local main_cmd="${SH[@]}"
|
||||
[ "$1" != "" ] && main_cmd="$(insert_quotes_on_spaces "$@")"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue