summaryrefslogtreecommitdiff
path: root/removeaccount.sh
blob: 43bf3b9d63b0778c45fd80b5c7c4ae884ee4a81f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/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.

title=$1

removeAccount() { sed -ie "
	/Account $title]/,/Account/{//!d}
	/Account $title]/d
	s/ $title\(,\|$\)//g
	s/=$title\(,\|$\)/=/g
	s/,$//g
	" ~/.offlineimaprc
	rm "$muttdir"accounts/$title.muttrc
	echo $title deleted. ;}
#removeAccount $title