diff --git a/src/larbs.sh b/src/larbs.sh index fffa10d..1772066 100755 --- a/src/larbs.sh +++ b/src/larbs.sh @@ -4,6 +4,12 @@ pacman -S --noconfirm --needed dialog || { echo "Error at script start: Are you dialog --title "Welcome!" --msgbox "Welcome to Luke's Auto-Rice Bootstrapping Script!\n\nThis script will automatically install a fully-featured i3wm Arch Linux desktop, which I use as my main machine.\n\n-Luke" 10 60 name=$(dialog --no-cancel --inputbox "First, please enter a name for the user account." 10 60 3>&1 1>&2 2>&3 3>&1) + +re="^[a-z_][a-z0-9_-]*$" +while ! [[ "${name}" =~ ${re} ]]; do + name=$(dialog --no-cancel --inputbox "Username not valid. Give a username beginning with a letter, with only lowercase letters, - and _." 10 60 3>&1 1>&2 2>&3 3>&1) +done + pass1=$(dialog --no-cancel --passwordbox "Enter a password for that user." 10 60 3>&1 1>&2 2>&3 3>&1) pass2=$(dialog --no-cancel --passwordbox "Retype password." 10 60 3>&1 1>&2 2>&3 3>&1)