armbian-firstlogin: Make sure that the first charactor of username isn't number

This commit is contained in:
hzy 2023-03-30 03:49:19 +08:00 committed by Igor Pečovnik
parent 76ce4c3a3d
commit 2a9279c27d

View File

@ -249,7 +249,7 @@ add_user()
while [ -f "/root/.not_logged_in_yet" ]; do
echo -e "\nPlease provide a username (eg. your first name): \c"
read -r -e username
if ! grep '^[a-zA-Z0-9]*$' <<< "$username" > /dev/null ; then
if ! grep '^[a-zA-Z][a-zA-Z0-9]*$' <<< "$username" > /dev/null ; then
echo -e "\n\x1B[91mError\x1B[0m: illegal characters in username"
return
fi