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

This commit is contained in:
Shilong Liu 2022-01-11 16:48:04 +08:00 committed by GitHub
parent 9b795dbf09
commit 94b778c39b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,7 +17,7 @@ REPR_MIRROR_URL_PATTERN='http:\/\/packages.trafficmanager.net\/debian'
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=''