Browse Source

Command to remove a mailing list folder

pull/55/head
Bob Mottram 7 years ago
parent
commit
11d451742f
  1. 4
      Makefile
  2. 1
      debian/source/include-binaries
  3. BIN
      man/freedombone-addcert.1.gz
  4. BIN
      man/freedombone-addemail.1.gz
  5. BIN
      man/freedombone-addlist.1.gz
  6. BIN
      man/freedombone-client.1.gz
  7. BIN
      man/freedombone-config.1.gz
  8. BIN
      man/freedombone-prep.1.gz
  9. BIN
      man/freedombone-remote.1.gz
  10. BIN
      man/freedombone-renew-cert.1.gz
  11. BIN
      man/freedombone-rmlist.1.gz
  12. BIN
      man/freedombone-sec.1.gz
  13. BIN
      man/freedombone.1.gz
  14. 12
      src/freedombone-addlist
  15. 67
      src/freedombone-rmlist

4
Makefile

@ -20,6 +20,7 @@ install:
install -m 755 src/${APP}-addlist ${DESTDIR}${PREFIX}/bin
install -m 755 src/${APP}-addemail ${DESTDIR}${PREFIX}/bin
install -m 755 src/${APP}-renew-cert ${DESTDIR}${PREFIX}/bin
install -m 755 src/${APP}-rmlist ${DESTDIR}${PREFIX}/bin
mkdir -m 755 -p ${DESTDIR}${PREFIX}/share/man/man1
install -m 644 man/${APP}.1.gz ${DESTDIR}${PREFIX}/share/man/man1
install -m 644 man/${APP}-prep.1.gz ${DESTDIR}${PREFIX}/share/man/man1
@ -31,6 +32,7 @@ install:
install -m 644 man/${APP}-addlist.1.gz ${DESTDIR}${PREFIX}/share/man/man1
install -m 644 man/${APP}-addemail.1.gz ${DESTDIR}${PREFIX}/share/man/man1
install -m 644 man/${APP}-renew-cert.1.gz ${DESTDIR}${PREFIX}/share/man/man1
install -m 644 man/${APP}-rmlist.1.gz ${DESTDIR}${PREFIX}/share/man/man1
uninstall:
rm -f ${PREFIX}/share/man/man1/${APP}.1.gz
rm -f ${PREFIX}/share/man/man1/${APP}-prep.1.gz
@ -42,6 +44,7 @@ uninstall:
rm -f ${PREFIX}/share/man/man1/${APP}-addlist.1.gz
rm -f ${PREFIX}/share/man/man1/${APP}-addemail.1.gz
rm -f ${PREFIX}/share/man/man1/${APP}-renew-cert.1.gz
rm -f ${PREFIX}/share/man/man1/${APP}-rmlist.1.gz
rm -rf ${PREFIX}/share/${APP}
rm -f ${PREFIX}/bin/${APP}
rm -f ${PREFIX}/bin/${APP}-prep
@ -53,6 +56,7 @@ uninstall:
rm -f ${PREFIX}/bin/${APP}-addlist
rm -f ${PREFIX}/bin/${APP}-addemail
rm -f ${PREFIX}/bin/${APP}-renew-cert
rm -f ${PREFIX}/bin/${APP}-rmlist
clean:
rm -f \#* \.#* debian/*.substvars debian/*.log
rm -fr deb.* debian/${APP}

1
debian/source/include-binaries

@ -8,3 +8,4 @@ man/freedombone-addcert.1.gz
man/freedombone-addlist.1.gz
man/freedombone-addemail.1.gz
man/freedombone-renew-cert.1.gz
man/freedombone-rmlist.1.gz

BIN
man/freedombone-addcert.1.gz

Binary file not shown.

BIN
man/freedombone-addemail.1.gz

Binary file not shown.

BIN
man/freedombone-addlist.1.gz

Binary file not shown.

BIN
man/freedombone-client.1.gz

Binary file not shown.

BIN
man/freedombone-config.1.gz

Binary file not shown.

BIN
man/freedombone-prep.1.gz

Binary file not shown.

BIN
man/freedombone-remote.1.gz

Binary file not shown.

BIN
man/freedombone-renew-cert.1.gz

Binary file not shown.

BIN
man/freedombone-rmlist.1.gz

Binary file not shown.

BIN
man/freedombone-sec.1.gz

Binary file not shown.

BIN
man/freedombone.1.gz

Binary file not shown.

12
src/freedombone-addlist

@ -79,11 +79,13 @@ if [ ! -d "$LISTDIR" ]; then
fi
chown -R $MYUSERNAME:$MYUSERNAME $LISTDIR
echo "" >> $PM
echo ":0" >> $PM
echo " * ^Subject:.*()\[$SUBJECTTAG\]" >> $PM
echo "$LISTDIR/new" >> $PM
chown $MYUSERNAME:$MYUSERNAME $PM
if ! grep -q "$LISTDIR/new" $PM; then
echo "" >> $PM
echo ":0" >> $PM
echo " * ^Subject:.*()\[$SUBJECTTAG\]" >> $PM
echo "$LISTDIR/new" >> $PM
chown $MYUSERNAME:$MYUSERNAME $PM
fi
if [ ! -f "$MUTTRC" ]; then
cp /etc/Muttrc $MUTTRC

67
src/freedombone-rmlist

@ -0,0 +1,67 @@
#!/bin/bash
# Removes a mailing list to the email configuration
# License
# =======
#
# Copyright (C) 2015 Bob Mottram <bob@robotics.uk.to>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
MYUSERNAME=$USER
MAILINGLIST=
function show_help {
echo ''
echo 'freedombone-rmlist -u [username] -l [mailing list name]'
echo ''
exit 0
}
while [[ $# > 1 ]]
do
key="$1"
case $key in
-h|--help)
show_help
;;
-u|--user)
shift
MYUSERNAME="$1"
;;
-l|--list)
shift
MAILINGLIST="$1"
;;
*)
# unknown option
;;
esac
shift
done
if ! [[ $MYUSERNAME && $MAILINGLIST ]]; then
show_help
fi
MUTTRC=/home/$MYUSERNAME/.muttrc
MUTT_MAILBOXES=$(grep "mailboxes =" $MUTTRC)
if [[ $MUTT_MAILBOXES == *$MAILINGLIST* ]]; then
sed -i "s| =$MAILINGLIST||g" $MUTTRC
chown $MYUSERNAME:$MYUSERNAME $MUTTRC
fi
exit 0
Loading…
Cancel
Save