mutt-wizard/removeaccount.sh

21 lines
455 B
Bash
Raw Normal View History

2018-02-10 07:47:29 +01:00
#!/bin/sh
2018-02-10 17:00:03 +01:00
muttdir="$HOME/.config/mutt/"
2018-02-10 07:47:29 +01:00
# 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. ;}
2018-02-10 17:00:03 +01:00
#removeAccount $title