aboutsummaryrefslogtreecommitdiff
path: root/src/anaconda
diff options
context:
space:
mode:
authorSamruddhi Khandale <skhandale@microsoft.com>2022-05-27 21:20:34 +0300
committerGitHub <noreply@github.com>2022-05-27 21:20:34 +0300
commite496022c568e9f6f42b41cda37f8d2e929eb3564 (patch)
treebbc1b77a68946a7ff301385c59fe7b3f19f06239 /src/anaconda
parent54bb1d4e25732c91f33083b625c2b2512a03c472 (diff)
fix username when automatic: hugo and anaconda (#31)
fix username when automatic
Diffstat (limited to 'src/anaconda')
-rw-r--r--src/anaconda/install.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/anaconda/install.sh b/src/anaconda/install.sh
index f7dfd0b..33870b9 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
-# Determine the appropriate non-root user
+# If in automatic mode, determine if a user already exists, if not use vscode
if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then
USERNAME=""
POSSIBLE_USERS=("vscode" "node" "codespace" "$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd)")
@@ -39,10 +39,12 @@ if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then
fi
done
if [ "${USERNAME}" = "" ]; then
- USERNAME=root
+ USERNAME=vscode
fi
-elif [ "${USERNAME}" = "none" ] || ! id -u ${USERNAME} > /dev/null 2>&1; then
+elif [ "${USERNAME}" = "none" ]; then
USERNAME=root
+ USER_UID=0
+ USER_GID=0
fi
architecture="$(uname -m)"