larbs

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 1e92f296220980c6215ff6cd8863f12f7aa20512
parent 46a37adf2c9ef896f89aab2c4ee5b7ff548fa80a
Author: Luke Smith <luke@lukesmith.xyz>
Date:   Mon, 25 Jun 2018 18:04:26 -0400

username now checked for validity

Diffstat:
Msrc/larbs.sh | 6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git 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)