summaryrefslogtreecommitdiff
path: root/removeaccount.sh
diff options
context:
space:
mode:
authorLuke <luke@lukesmith.xyz>2018-02-11 17:58:16 -0700
committerLuke <luke@lukesmith.xyz>2018-02-11 17:58:16 -0700
commit5c4b388d537f41851f4d06b545dcb4362427aaaa (patch)
treee6d9f85c8f0cea26749aa1fbcdb756cc98baaa87 /removeaccount.sh
parente79d940a32a1884a1b14c8dab4ec07476f9bf5d6 (diff)
integration into single script
Diffstat (limited to 'removeaccount.sh')
-rwxr-xr-xremoveaccount.sh39
1 files changed, 0 insertions, 39 deletions
diff --git a/removeaccount.sh b/removeaccount.sh
deleted file mode 100755
index d4cd0a0..0000000
--- a/removeaccount.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/sh
-muttdir="$HOME/.config/mutt/"
-
-# This script will remove an account from ~/.offlineimaprc and the
-# designated location in ~/.config/mutt/accounts.
-
-# Feed the script the title of the account.
-
-cat ~/.offlineimaprc | grep "^accounts =" | sed -e 's/accounts =\( \)//g;s/\(,\) /\n/g;' | nl --number-format=ln > /tmp/numbered
-
-removeAccount() { sed -ie "
- /Account $1]/,/Account/{//!d}
- /Account $1]/d
- s/ $1\(,\|$\)//g
- s/=$1\(,\|$\)/=/g
- s/,$//g
- " ~/.offlineimaprc
- rm "$muttdir"accounts/$1.muttrc
- rm "$muttdir"credentials/$1.gpg
- rm -rf "$muttdir"accounts/$1
- echo $1 deleted. ;}
-
-#/tmp/numbered
-
-accounts=()
-while read n s ; do
- accounts+=($n "$s" off)
-done < /tmp/numbered
-
-choices=$(dialog --separate-output --checklist "Choose an email account to remove." 22 76 16 "${accounts[@]}" 2>&1 >/dev/tty)
-clear
-
-if [ -z "$choices" ];
- then
- clear
- else
- todelet=$(IFS="|"; keys="${choices[*]}"; keys="${keys//|/\\|}"; grep -w "${keys}" /tmp/numbered | awk '{print $2}')
- for i in $todelet; do removeAccount $i; done
-fi