Skip to content

Commit 94b778c

Browse files
[build] docker-sonic-mgmt replace USER by whoami (#9702)
1 parent 9b795db commit 94b778c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/sonic-build-hooks/scripts/buildinfo_base.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ REPR_MIRROR_URL_PATTERN='http:\/\/packages.trafficmanager.net\/debian'
1717

1818
URL_PREFIX=$(echo "${PACKAGE_URL_PREFIX}" | sed -E "s#(//[^/]*/).*#\1#")
1919

20-
if [ $USER != 'root' ] && [ -n $(which sudo) ];then
20+
if [ "$(whoami)" != "root" ] && [ -n "$(which sudo)" ];then
2121
SUDO=sudo
2222
else
2323
SUDO=''

0 commit comments

Comments
 (0)