Browse Source

loop

tags/v3.1
Luke Smith 5 years ago
parent
commit
19c4fdb2c5
No known key found for this signature in database GPG Key ID: 4C50B54A911F6252
1 changed files with 19 additions and 25 deletions
  1. +19
    -25
      mw

+ 19
- 25
mw View File

@@ -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 <<EOF
@@ -221,29 +221,23 @@ detectMailboxes() { \

[ -z "$gpgemail" ] && askgpg

while : ;
do
choice=$(dialog --title "Luke's mutt/offlineIMAP wizard" --nocancel \
--menu "What would you like to do?" 15 50 8 \
0 "Add email account (Begin installtion)" \
1 "Autodetect mailboxes (Finalize installation)" \
2 "Enable/disable autosync." \
3 "Change an account's password" \
4 "Remove an account" \
5 "Remove all accounts" \
6 "Change your GPG email" \
7 "Exit this wizard." \
3>&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"

Loading…
Cancel
Save