allow numbers in username, except for first character

This commit is contained in:
Dan Johansen 2021-03-25 18:34:22 +01:00
parent 04b8d67bba
commit 5a8f9bf9a2
No known key found for this signature in database
GPG Key ID: 084A7FC0035B1D49
1 changed files with 2 additions and 2 deletions

View File

@ -394,9 +394,9 @@ fi
if [ ! -z "$EDITION" ]; then if [ ! -z "$EDITION" ]; then
USER=$(dialog --clear --title "Manjaro ARM Installer" \ USER=$(dialog --clear --title "Manjaro ARM Installer" \
--inputbox "Enter the username you want: --inputbox "Enter the username you want:
(usernames most be all lowercase)" 8 50 \ (usernames must be all lowercase and first character may not be a number)" 8 50 \
3>&1 1>&2 2>&3 3>&-) 3>&1 1>&2 2>&3 3>&-)
if [[ "$USER" =~ [A-Z] ]] || [[ "$USER" =~ [0-9] ]] || [[ "$USER" == *['!'@#\$%^\&*()_+]* ]]; then if [[ "$USER" =~ [A-Z] ]] || [[ "$USER" =~ ^[0-9] ]] || [[ "$USER" == *['!'@#\$%^\&*()_+]* ]]; then
clear clear
msg "Configuration aborted! Username contained invalid characters." msg "Configuration aborted! Username contained invalid characters."
exit 1 exit 1