[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 ee84ba81ed
commit f5c876edf3

View File

@ -18,7 +18,7 @@ DPKG_INSTALLTION_LOCK_FILE=/tmp/.dpkg_installation.lock
URL_PREFIX=$(echo "${PACKAGE_URL_PREFIX}" | sed -E "s#(//[^/]*/).*#\1#") 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 SUDO=sudo
else else
SUDO='' SUDO=''