[build] docker-sonic-mgmt replace USER by whoami (#9702)

This commit is contained in:
Shilong Liu 2022-01-11 16:48:04 +08:00
parent 0bbd384c9b
commit 76feaac0b6

View File

@ -18,7 +18,7 @@ DPKG_INSTALLTION_LOCK_FILE=/tmp/.dpkg_installation.lock
URL_PREFIX=$(echo "${PACKAGE_URL_PREFIX}" | sed -E "s#(//[^/]*/).*#\1#")
if [ $USER != 'root' ] && [ -n $(which sudo) ];then
if [ "$(whoami)" != "root" ] && [ -n "$(which sudo)" ];then
SUDO=sudo
else
SUDO=''