aboutsummaryrefslogtreecommitdiff
path: root/src/hugo/install.sh
diff options
context:
space:
mode:
authorJosh Spicer <josh@joshspicer.com>2022-05-31 20:25:12 +0300
committerGitHub <noreply@github.com>2022-05-31 20:25:12 +0300
commitba5967b12612891568e450b10d7935c69a66bfad (patch)
treedf3a694ebb5da97ce9b188c9be3995b329493eca /src/hugo/install.sh
parent8fa5b691cf68f30394060b0e7095c411cb22b8d3 (diff)
parent62086e33f3a8425397c838efe33a6290c44da415 (diff)
Merge branch 'main' of https://github.com/devcontainers/features
Diffstat (limited to 'src/hugo/install.sh')
-rw-r--r--src/hugo/install.sh8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/hugo/install.sh b/src/hugo/install.sh
index c901ab7..de1d03c 100644
--- a/src/hugo/install.sh
+++ b/src/hugo/install.sh
@@ -27,7 +27,7 @@ rm -f /etc/profile.d/00-restore-env.sh
echo "export PATH=${PATH//$(sh -lc 'echo $PATH')/\$PATH}" > /etc/profile.d/00-restore-env.sh
chmod +x /etc/profile.d/00-restore-env.sh
-# If in automatic mode, determine if a user already exists, if not use vscode
+# Determine the appropriate non-root user
if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then
USERNAME=""
POSSIBLE_USERS=("vscode" "node" "codespace" "$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd)")
@@ -38,12 +38,10 @@ if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then
fi
done
if [ "${USERNAME}" = "" ]; then
- USERNAME=vscode
+ USERNAME=root
fi
-elif [ "${USERNAME}" = "none" ]; then
+elif [ "${USERNAME}" = "none" ] || ! id -u ${USERNAME} > /dev/null 2>&1; then
USERNAME=root
- USER_UID=0
- USER_GID=0
fi
architecture="$(uname -m)"