From 5e37bab6be045803f006ae9622b1a84091bb32d0 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 11 Feb 2016 10:02:11 +0000 Subject: [PATCH] Insert before encrypt --- src/freedombone-addlist | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/freedombone-addlist b/src/freedombone-addlist index 1eb5d1ac..5ffbd334 100755 --- a/src/freedombone-addlist +++ b/src/freedombone-addlist @@ -100,7 +100,7 @@ fi chown -R $MYUSERNAME:$MYUSERNAME $LISTDIR if ! grep -q "Subject:.*()\[$SUBJECTTAG\]" $PM; then - if ! grep -q "End of rule" $PM; then + if ! grep -q "\# encrypt" $PM; then echo "" >> $PM echo "/# Email rule for $MAILINGLIST subject \[$SUBJECTTAG\]" >> $PM echo ":0" >> $PM @@ -109,12 +109,13 @@ if ! grep -q "Subject:.*()\[$SUBJECTTAG\]" $PM; then echo "/# End of rule" >> $PM chown $MYUSERNAME:$MYUSERNAME $PM else - sed -i "/End of rule/a + sed -i "/\# encrypt/i /# Email rule for $MAILINGLIST subject \[$SUBJECTTAG\] :0 * ^Subject:.*()\[$SUBJECTTAG\] $LISTDIR/new -/# End of rule" $PM +/# End of rule +" $PM fi fi