display name support

This commit is contained in:
Patrick 2024-11-15 23:50:18 +01:00
parent 1de8b2ebae
commit 1034adbf9e

View file

@ -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'"