From 1034adbf9ed8745d722aa72a4f55e0ea2dfeb347 Mon Sep 17 00:00:00 2001 From: Patrick Date: Fri, 15 Nov 2024 23:50:18 +0100 Subject: [PATCH] display name support --- configs/scripts/user.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/configs/scripts/user.sh b/configs/scripts/user.sh index e9db0f9..9dc0472 100755 --- a/configs/scripts/user.sh +++ b/configs/scripts/user.sh @@ -6,7 +6,7 @@ trap '' SIGINT SIGTERM while true; do - read -p "Enter a username (lowercase letters, digits, underscores and hyphens): " username + read -p "Enter a username (letters, prefferably only lowercase, digits, underscores and hyphens): " username chroot /mnt /bin/bash -c "useradd -m '$username'" if [ $? -eq 0 ]; then @@ -14,6 +14,15 @@ while true; do fi done +while true; do + read -p "Enter a display name: " fullname + chroot /mnt /bin/bash -c "usermod -c '$fullname' '$username'" + + if [ $? -eq 0 ]; then + break + fi +done + while true; do chroot /mnt /bin/bash -c "passwd '$username'"