diff options
author | Luke Smith <luke@lukesmith.xyz> | 2018-08-26 04:13:54 -0400 |
---|---|---|
committer | Luke Smith <luke@lukesmith.xyz> | 2018-08-26 04:13:54 -0400 |
commit | b3122a2c2e3f4fe1f4d24b9d95b9e32319ba481d (patch) | |
tree | dfd96d356e51211c44ef9ba7c648f2cc929f37ff /mutt-wizard.sh | |
parent | 1a4d5d6fade2998a5ecabf53c9c19a59125cb816 (diff) |
abstract name checked to regex
Diffstat (limited to 'mutt-wizard.sh')
-rwxr-xr-x | mutt-wizard.sh | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/mutt-wizard.sh b/mutt-wizard.sh index be166b4..2bff580 100755 --- a/mutt-wizard.sh +++ b/mutt-wizard.sh @@ -145,7 +145,11 @@ $serverinfo EOF fi realname=$( dialog --title "Luke's mutt/offlineIMAP autoconfig" --inputbox "Enter the full name you'd like to be identified by on this email account." 10 60 3>&1 1>&2 2>&3 3>&- ) -title=$( dialog --title "Luke's mutt/offlineIMAP autoconfig" --inputbox "Give a short, one-word name for this email account that will differentiate it from other email accounts." 10 60 3>&1 1>&2 2>&3 3>&- ) +title=$(dialog --title "Luke's mutt/offlineIMAP autoconfig" --inputbox "Give a short, one-word name for this email account that will differentiate it from other email accounts." 10 60 3>&1 1>&2 2>&3 3>&1) || exit +namere="^[a-z_][a-z0-9_-]*$" +while ! [[ "${title}" =~ ${namere} ]]; do + title=$(dialog --no-cancel --title "Luke's mutt/offlineIMAP autoconfig" --inputbox "Account title not valid. Give a username beginning with a letter, with only lowercase letters, - or _." 10 60 3>&1 1>&2 2>&3 3>&1) +done login=$(dialog --title "Luke's mutt/offlineIMAP autoconfig" --inputbox "If you have a username for the \"$title\" account which is different from your email address, enter it here. Otherwise leave this prompt blank." 10 60 3>&1 1>&2 2>&3 3>&- ) # Sets the repo type and other variables for the sed regex. if [[ "$service" == "gmail.com" ]]; |