summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2019-04-22 13:54:22 -0400
committerLuke Smith <luke@lukesmith.xyz>2019-04-22 13:54:22 -0400
commit71d6bf9e659591fae025bd3e779942d8b23b8820 (patch)
treeca10ce5d50f3cc66421cf5d51f4e3d70e4450c7a
parent0c452213e76b912f404e4d56c6991fc36fe888d4 (diff)
prevent multiple homonymous accounts
-rwxr-xr-xbin/mw4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/mw b/bin/mw
index 7cf7b4c..c058e73 100755
--- a/bin/mw
+++ b/bin/mw
@@ -142,8 +142,8 @@ EOF
read -r realname
printf "Enter a short, \033[36mone-word identifier\033[0m for this email account that will distinguish them from any other accounts you add.\\n\tAccount name: "
read -r title
- while ! echo "$title" | grep "$namere" >/dev/null; do
- printf "\033[31mTry again\033[0m. Pick a nickname that is one word only including lowercase letters and _ or -.\\n\tAccount name: \033[36m\t"
+ while ! echo "$title" | grep "$namere" >/dev/null || ls "$accdir"/[0-9]"-$title.muttrc" >/dev/null 2>&1; do
+ printf "\033[31mTry again\033[0m. Pick a nickname that is one word only including lowercase letters and _ or - and that you have \033[1mnot\033[0m used before.\\n\tAccount name: \033[36m\t"
read -r title
printf "\033[0m"
done