Fix the failure in finding the executing user's ID during install (#18508) ##build

The `UID` variable used previously is a Bash extension that isn't present on all
POSIX shells.
This commit is contained in:
soroosh-chabi 2021-03-29 03:02:44 +04:30 committed by GitHub
parent dcfd5fed5f
commit 6d21fcfe8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,6 @@
#!/bin/sh
if [ "$UID" = 0 ]; then
if [ "$(id -u)" = 0 ]; then
echo "[XX] Do not run this script as root!"
if [ -n "${SUDO_USER}" ]; then
echo "[--] Downgrading credentials to ${SUDO_USER}"