|
@@ -32,10 +32,11 @@
|
32
|
32
|
MYUSERNAME=$USER
|
33
|
33
|
MAILINGLIST=
|
34
|
34
|
SUBJECTTAG=
|
|
35
|
+LIST_ADDRESS=
|
35
|
36
|
|
36
|
37
|
function show_help {
|
37
|
38
|
echo ''
|
38
|
|
- echo 'freedombone-addlist -u [username] -l [mailing list name] -s [subject tag]'
|
|
39
|
+ echo 'freedombone-addlist -u [username] -l [mailing list name] -s [subject tag] -e [list email address]'
|
39
|
40
|
echo ''
|
40
|
41
|
exit 0
|
41
|
42
|
}
|
|
@@ -60,6 +61,10 @@ case $key in
|
60
|
61
|
shift
|
61
|
62
|
SUBJECTTAG="$1"
|
62
|
63
|
;;
|
|
64
|
+ -e|--email)
|
|
65
|
+ shift
|
|
66
|
+ LIST_ADDRESS="$1"
|
|
67
|
+ ;;
|
63
|
68
|
*)
|
64
|
69
|
# unknown option
|
65
|
70
|
;;
|
|
@@ -113,4 +118,11 @@ if [[ $MUTT_MAILBOXES != *$MAILINGLIST* ]]; then
|
113
|
118
|
chown $MYUSERNAME:$MYUSERNAME $MUTTRC
|
114
|
119
|
fi
|
115
|
120
|
|
|
121
|
+if [ $LIST_ADDRESS ]; then
|
|
122
|
+ sed -i "s|unsubscribe $LIST_ADDRESS|subscribe $LIST_ADDRESS|g" $MUTTRC
|
|
123
|
+ if ! grep -q "subscribe $LIST_ADDRESS" $MUTTRC; then
|
|
124
|
+ echo "subscribe $LIST_ADDRESS" >> $MUTTRC
|
|
125
|
+ fi
|
|
126
|
+fi
|
|
127
|
+
|
116
|
128
|
exit 0
|