From 11d451742fadf2dcdd5a9b581385f070fa67369d Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 3 Apr 2015 23:23:32 +0100 Subject: [PATCH] Command to remove a mailing list folder --- Makefile | 4 ++ debian/source/include-binaries | 1 + man/freedombone-addcert.1.gz | Bin 514 -> 517 bytes man/freedombone-addemail.1.gz | Bin 548 -> 552 bytes man/freedombone-addlist.1.gz | Bin 530 -> 535 bytes man/freedombone-client.1.gz | Bin 805 -> 809 bytes man/freedombone-config.1.gz | Bin 776 -> 780 bytes man/freedombone-prep.1.gz | Bin 1342 -> 1346 bytes man/freedombone-remote.1.gz | Bin 780 -> 784 bytes man/freedombone-renew-cert.1.gz | Bin 1689 -> 1693 bytes man/freedombone-rmlist.1.gz | Bin 0 -> 702 bytes man/freedombone-sec.1.gz | Bin 789 -> 793 bytes man/freedombone.1.gz | Bin 3910 -> 3914 bytes src/freedombone-addlist | 12 +++--- src/freedombone-rmlist | 67 ++++++++++++++++++++++++++++++++ 15 files changed, 79 insertions(+), 5 deletions(-) create mode 100644 man/freedombone-rmlist.1.gz create mode 100755 src/freedombone-rmlist diff --git a/Makefile b/Makefile index 5dc07d6c..7d8d2d03 100644 --- a/Makefile +++ b/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} diff --git a/debian/source/include-binaries b/debian/source/include-binaries index 410b2514..338df424 100644 --- a/debian/source/include-binaries +++ b/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 diff --git a/man/freedombone-addcert.1.gz b/man/freedombone-addcert.1.gz index 060734148eb3373bc154fec6fc0e3ecccabca86c..a30c43ff363f6a24db3ee5c9ebf8214b9002eaa6 100644 GIT binary patch delta 502 zcmV{`3;K15)ImYs!?Gzg8{N>zcuru2=h6c%t`%2En$(Eus9!(4K8>YaRDtvAU$ zx!&KeA*;z)#any;UqB|PS61&qP;o#wWZcbkw+6C?+zd&|{SjoOE3TwDBRyojlJ?;= z_imDmxARRpU#~niKFD@|;`qOGAI;esp^{Ii;4CRPHQOc8)NLr;caGgaZ+L|u&4@8@ z=fB1nTXzSQylM8Zryc}Xz#BtgIux?pgDaE27|?O;YAkAVo*wU}Zhc$q$TiOU%K5M? zh@rN&Govu9q^z%cu6L7K6fJC%@4yovpVXiz$aCS?g8{ z?{msOYRbt@~ delta 499 zcmV1<4G& zRkVyfcCFoaA0jY9%hp0c8iYn}r7FQ-UHC?p3Ulb0vXFvXG(ZaOFq2%JdM963>rFCG zuJ`vV*jHq%;tf84FJLdIQ&t~9P~IaP_T0^Mw;J{}xfzm_`y<$sF1eECjC8Q?l(Y}0 zxp#3g+0HlVe7*A6q?he~#PNUWKAN)?LMfk6!C6vpYPL(FsoPL`XdSzT&hQdJnh|5* z&VP+Dwr+csysi&$pbi9Az-vQbS`@N4fGd-~7|?RT9m(JE(kBupVC0Xls2=6n> zK5ELyN@0TTF|hQ31({}>=_Z_RrXz@>celg%=Jtq=rESpk(T-re^oQcUtD5oCm%Pxk pYC+%9+_aO&&nQzG(mOQC;#hT$+31*r3*z}K_7hTEP0pkP000;B|B3(r diff --git a/man/freedombone-addemail.1.gz b/man/freedombone-addemail.1.gz index 62d38bb5e3896b302776330e7ffcafec000bae9b..ef879b1752595283f4529d983b2d7d01607b9528 100644 GIT binary patch delta 131 zcmV-}0DS+X1gHcCABzY80ur$XuK{y0>Z%rtDPae@-Nn2=nfYF%IgGTUiB#~JYkqGu z*G{B1sGkC-zjy&R-n2Ijd(&PA;_j!roA~ywK_lS~q15AAKA+Ei=qBC l&usPZ^c}@qn+4ir*qnMq-f8+n?K!>6`wO>Zk&7_|007vFL8Jfx delta 127 zcmV-_0D%9f1f&E8ABzY8?E|p}uK{ndm=bpI)m_Z{lbP>Dn!`vt8a)M{x#ssqbL~WG zgZe3O`imEE<4t?hus7{>Anty;yNPe_8Z;8_FsB`eMy;Flu`X1!{*kRrzZmLY^UPKc hPv23@wOOD|hRvx*$ zFUykMrM3Uw0qNCBO(eYRnVB=^oN+f3NEKotMI=jfSdtW68yJ9nJAgS;aPw;L+6J5c zkH7n1t5H4E)KJ!}ur13CCtxo|^T4*Q(S37Zlq4D$2*wLuX3)Y$g2@rE0YRU%LD5l# zUlz+%I1R7UIW_ERQcyC1dvFTaUC?&0hMlgX?-+?YxaJuf2zlUcoEaN zioHLA^SIVE>hslu07kQLd2#jUgBLIV&N@bAuHkKhy+T}Ya?pomnewa$R|=~hs8C4L zmqN+l(YdNdi6-eDtT866^E=vZCd;*L`7(mJG;}-xZzCDKS2B`@$J(tQT_fLFZltW$ zc;$^(;~@m2H+MI|?Olud+z8Z~WjF+X?%c!=buRqF=Ok5=d?vqc5?$RtenP&HYKuCY ZwNnom4ci0JeJ*!dKLMP&M+y=I008$T_jCXN literal 530 zcmV+t0`2`DiwFSy10PiY1C3E#kJB&^e9x~~??X>jYvkB=zX_1KX;@REVnH_&UhEyXaN^(`A$C9KF#zG(5+dj;ghMQOY*Dkp9 zfBfAC8-x0pp@y<%h3hzeGzND*oQ1A)jqaNV!z3}lKr&H?GJ_Vj3T%#m4G89FEXs~5 z`Z8ZEqe*m~&Z}WtlY){-+<{lX_KdcJ4Qx%#zhg{`Shnk!KZMc!YO-8U7IWA6Pf>n1 z8~$LjDvamZFpKkkK}ZeU^AkaR#+)*f!7%w)H;3uxwVxU^m-Y2sJS02+2hRQ zI_~{(xSlYkMsrF%3}HBp7H6qH@4tBY_pM{p_8Q(^@S+eGf*f4Js!T<80aqHU3s9p} z_EHL61`pm;FG8{lK^KRmYI+wxzbCT+DK2=}WiK*@%KcQGFy+IRA+o=cS UgEk2Y;(V9$6KiSs;QIpr0Io*&xc~qF diff --git a/man/freedombone-client.1.gz b/man/freedombone-client.1.gz index cf3308a5e0dc05b1409a1e8d9968591b57b45498..bd8aadcbb18160f7241c63644fafa478bbef194f 100644 GIT binary patch delta 137 zcmV;40CxYS2B`)HABzY8DH5>;ssefO_0^{Q5@D=gc)Z=*tsc^3;tIHTL|)YJQ{jqV zyek}O8M1btk^4Ex3ZJZJ>)~uY8^Lt^WhvAzyS^k64U4g;=1sy^?W%YT4EdtVdcVnfSq&0 zF}ktLOQW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;nIM4|<-xmY!S@nbtq>=1Qxosh*z#^#-C~-A$r(kJOf^ZQBOw z`gR7nu_4{Lqj_X;V(}`FPH!i~aQoBh^%$?ONQ_$y*T$O-or&*G>8D0EP|h{z4j+ff z1V*!L@#M?%%f+uRpA3jf5orB69O<<)Xb}t zXTuo6c%EE}Pfbyc@Bfy$y)I_v-<5Rr`|U?mD`VH_vRPn#LOu+mph-N<6@3H0gcLF` G1^@t%ihzLt diff --git a/man/freedombone-prep.1.gz b/man/freedombone-prep.1.gz index 87d32c1c9d24d34beaafb856982938d386ecb1ae..cf25be70e37c0e0e5b50df7cad55fd67e35df812 100644 GIT binary patch delta 137 zcmV;40CxYr3c?BoABzY8KN7J9!vuMm{9ss%oNP_W!-x6x-F+t-=@f3XbB5*cA=T+` zMyHyDV&iHRJN+?=QxnauX1%M~)dh@)@81o^XYYb_Bpr#<(uBQ$(M@;2zgAg3T7MA> rbDd4~Uvpv0Ppdyr&b4_!n@q#4ub5s0j)y3a<0t-+GHATeZ}-5kU?C$j1~O@Iy*H>_6h(1si8f( diff --git a/man/freedombone-remote.1.gz b/man/freedombone-remote.1.gz index d9e2fa37cc62f23304ea52a5501a037bc208899d..4eb489846717da061065e3689d4d49a6f713d5ab 100644 GIT binary patch delta 134 zcmV;10D1q629O2@ABzY8OA@gLlmd2f`Xs4GPFOea;C68}yGfIwEn#Xya7@FWr7iz< zwzNTUpEv6~*uUDP%rED?%lTy=MuWF+&PT7`wCGR;O~$8N+lS#aJLm5ksfU~Y#nN5L oiT$(?zP?z$L$$E(7JV^ktKMVTZ#P5>ddQW02ZSciMI;6Q0K&&Xl>h($ delta 130 zcmV-|0Db?E28;#a_J5&qnZqXN$w(32W{dN_!iHBUtcXS?aDGdey01(7L#{d8T diff --git a/man/freedombone-renew-cert.1.gz b/man/freedombone-renew-cert.1.gz index 2a6741b3437107c872bb53f3d67d7037ab4508b3..84a138385a80dc2cf23dc928e923cbba992ddd24 100644 GIT binary patch delta 79 zcmV-V0I>g=4V?`JABzY8SQ4=Y90nk5{h~uBbFB5rj&A3lu5aRKY%;nu9$x`!`ZY7z ld)&H{J_aEIU%!)K1|<{dA19$YD9*mG=pRoOKYD)-007cG9?$>) delta 103 zcmV-t0GR)s4VeuFABzY8Rs^vI90os~%(2#IHM*UDy1t2{vB~Jtc--}C`ZY7zdt9%L zSGh~ths2xTq9n7?^lX}*P0vnfGWzA+@#Lp>VRfuL-?Nit1|<_{6epn!sKUOl=pPu= Jetc*S0032kGgbfq diff --git a/man/freedombone-rmlist.1.gz b/man/freedombone-rmlist.1.gz new file mode 100644 index 0000000000000000000000000000000000000000..3165ec6ccbcfb2cbf5c74bea0f3d8397a36df47d GIT binary patch literal 702 zcmV;v0zv&BiwFSN5Fb?l18q~=j@mE~ea}~n^0KW|lD(+X7FAVYOJUVzL0r0Ow|#J& z39&Y|Q(vI`ea9hDO96!l#xrNmoHVZ)1q* z`TREx))vi$g(*{>RdEz0%L&AfgXt)a&Y=D1!2+e;q6G$$iAtyqG$&4jD-kdR!S1a? z*@7*g?t7!GXE|iP8aG_0FYKdvL$u#N2Gdv2Ftg`xy(#@iX zfFb{hDi;Rmi`;3mPoP;bJya$#G|VCOV{L2DbqEPfN(3nxIgl2-u|b@JdWUv7WK_ku z$VsZCwbJM}lXZn;cc9OCTgrVmO|WGw_pLF*d3R5S>oM7SfweZ&(o=WVs8Kps+kTpE z$aOwTNbfXbwlqBbr&lVh^=P|WG8)0)VL3axC9ketzxjWI9F02{Z|ryOAP_!@^Gc8& zr(vxMu{jCX2J4exFr_=CXi(v3BZw!)WmC_Ih-4+eC-LNwk)2un)s&@0vgPQVzFY^TJHZ2mO7O k+xqV13yPICYqZOUrs@f^ezPH3&~dNm4~-&H6hs9806x@NQ2+n{ literal 0 HcmV?d00001 diff --git a/man/freedombone-sec.1.gz b/man/freedombone-sec.1.gz index 60f8906f39cab38b6b651f73ce85a0c4e097717c..d70929c9d1ea479d8ad66b48353fe56196ab84bc 100644 GIT binary patch delta 134 zcmV;10D1qF2AKv1ABzY8Y!a~sodR}MmZlrH3^PyG<=yHjO{ThnrFPD+4&GI|dT(^4 z=^3-R-{wyLn&g#99_Npv`Qv;Hv&k=SZ)ZQfjp$UkF8H*;F-(`)ZT-o&-E{W{- z{Wf>{*Cek@@;HAS%^&Aum`#3pdprB-ZA7QSb-|Dgj$yjYZtG9J?WVgw_{Q9|3;k!w kZU15WJBm`9HQHhkvp!)pj@zJRyzG_y0}?=hi%tdr0L0fo6951J diff --git a/man/freedombone.1.gz b/man/freedombone.1.gz index d7da56b861d0b798bf24b605c9f51882fcb3ee7b..7f5372b0ef78e104901fecf63341df64bde335da 100644 GIT binary patch delta 75 zcmV-R0JQ(c9?BjDABzY8fD*9=$qpac<|r+ahgd5gSmvK6vlG-l0lO7SA2#wftGP7001HH9U=e# delta 71 zcmV-N0J#6k9>yL9ABzY8kpr;?$qpNmhgd6LQs$p0vlA3K0lO7SA)vEA1tRznm6en3 d4k7}J<&zQ*C=k{N6w2SpKtft5004st8D#(f diff --git a/src/freedombone-addlist b/src/freedombone-addlist index cfcff995..fef2b06f 100755 --- a/src/freedombone-addlist +++ b/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 diff --git a/src/freedombone-rmlist b/src/freedombone-rmlist new file mode 100755 index 00000000..343b8ba2 --- /dev/null +++ b/src/freedombone-rmlist @@ -0,0 +1,67 @@ +#!/bin/bash + +# Removes a mailing list to the email configuration + +# License +# ======= +# +# Copyright (C) 2015 Bob Mottram +# +# 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 . + +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