Browse Source

subscribe command in muttrc

pull/55/head
Bob Mottram 7 years ago
parent
commit
3a3b1784a8
  1. BIN
      man/freedombone-addlist.1.gz
  2. BIN
      man/freedombone-rmlist.1.gz
  3. 14
      src/freedombone-addlist
  4. 13
      src/freedombone-rmlist

BIN
man/freedombone-addlist.1.gz

Binary file not shown.

BIN
man/freedombone-rmlist.1.gz

Binary file not shown.

14
src/freedombone-addlist

@ -32,10 +32,11 @@
MYUSERNAME=$USER
MAILINGLIST=
SUBJECTTAG=
LIST_ADDRESS=
function show_help {
echo ''
echo 'freedombone-addlist -u [username] -l [mailing list name] -s [subject tag]'
echo 'freedombone-addlist -u [username] -l [mailing list name] -s [subject tag] -e [list email address]'
echo ''
exit 0
}
@ -60,6 +61,10 @@ case $key in
shift
SUBJECTTAG="$1"
;;
-e|--email)
shift
LIST_ADDRESS="$1"
;;
*)
# unknown option
;;
@ -113,4 +118,11 @@ if [[ $MUTT_MAILBOXES != *$MAILINGLIST* ]]; then
chown $MYUSERNAME:$MYUSERNAME $MUTTRC
fi
if [ $LIST_ADDRESS ]; then
sed -i "s|unsubscribe $LIST_ADDRESS|subscribe $LIST_ADDRESS|g" $MUTTRC
if ! grep -q "subscribe $LIST_ADDRESS" $MUTTRC; then
echo "subscribe $LIST_ADDRESS" >> $MUTTRC
fi
fi
exit 0

13
src/freedombone-rmlist

@ -31,10 +31,11 @@
MYUSERNAME=$USER
MAILINGLIST=
LIST_ADDRESS=
function show_help {
echo ''
echo 'freedombone-rmlist -u [username] -l [mailing list name]'
echo 'freedombone-rmlist -u [username] -l [mailing list name] -e [list email address]'
echo ''
exit 0
}
@ -55,6 +56,10 @@ case $key in
shift
MAILINGLIST="$1"
;;
-e|--email)
shift
LIST_ADDRESS="$1"
;;
*)
# unknown option
;;
@ -73,4 +78,10 @@ if [[ $MUTT_MAILBOXES == *$MAILINGLIST* ]]; then
chown $MYUSERNAME:$MYUSERNAME $MUTTRC
fi
if [ $LIST_ADDRESS ]; then
if ! grep -q "unsubscribe $LIST_ADDRESS" $MUTTRC; then
sed -i "s|subscribe $LIST_ADDRESS|unsubscribe $LIST_ADDRESS|g" $MUTTRC
fi
fi
exit 0

Loading…
Cancel
Save