aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/anaconda/install.sh8
-rw-r--r--src/hugo/install.sh8
2 files changed, 6 insertions, 10 deletions
diff --git a/src/anaconda/install.sh b/src/anaconda/install.sh
index 33870b9..f7dfd0b 100644
--- a/src/anaconda/install.sh
+++ b/src/anaconda/install.sh
@@ -28,7 +28,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)")
@@ -39,12 +39,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)"
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)"