diff --git a/mw b/mw index b1b8341..c6d09ff 100755 --- a/mw +++ b/mw @@ -110,7 +110,7 @@ addaccount() { \ read -r smtp printf "What is your server's SMTP port number? (Usually 587 or 465)\\n" read -r sport - printf "Great. If you want to be helpful, copy the line below and you can add it to the \`domains.csv\` file on Github. This will make things easier for others who use your email provider.\\n\\n%s,%s,%s,%s,%s\\n\\nAlthough be sure to test to see if these settings work first! ;-)\\n" "$domain" "$imap" "$iport" "$smtp" "$sport" + printf "\\nGreat! If you want to be helpful, copy the line below and you can add it to the \`domains.csv\` file on Github.\\nThis will make things easier for others who use your email provider.\\n\\n%s,%s,%s,%s,%s\\n\\nAlthough be sure to test to see if these settings work first! ;-)\\n" "$domain" "$imap" "$iport" "$smtp" "$sport" exit else IFS=, read service imap iport smtp sport <&1 1>&2 2>&3 3>&1 ) - -case $choice in -0) addaccount ;; -1) detectWarning && chooseDetect;; -3) inventory && for i in $userchoices; do getpass "$i" ; done;; -4) inventory && for i in $userchoices; do removeAccount "$i" ; done;; -5) (dialog --defaultno --title "Wipe all custom neomutt/offlineIMAP settings?" --yesno "Would you like to wipe all of the mutt/offlineIMAP settings generated by the system?" 6 60 && wipe) ;; -6) askgpg ;; -7) clear && break ;; -*) echo "Error. Are you sure you have dialog installed?" >&2; exit 2 -esac +main() { \ + while : ; do + printf "What would you like mutt-wizard to do? + 1 Add an email account + 2 Autodetect mailboxes + 3 Change an account's password + 0 Exit +Input a number to continue or press ctrl-c.\\n" + read -r choice + case "$choice" in + 1) addaccount ;; + 0) break ;; + *) printf "Invalid input.\\n" + esac done +} + +main + rm -rf "$tmpdir"