Browse Source

Only add rules if they don't already exist

pull/55/head
Bob Mottram 7 years ago
parent
commit
8d1240017b
  1. 12
      src/freedombone-addemail
  2. 2
      src/freedombone-addlist

12
src/freedombone-addemail

@ -73,11 +73,13 @@ if [ ! -d "$LISTDIR" ]; then
mkdir -m 700 $LISTDIR/cur
fi
chown -R $MYUSERNAME:$MYUSERNAME $LISTDIR
echo "" >> $PM
echo ":0" >> $PM
echo " * ^From: $EMAILADDRESS" >> $PM
echo "$LISTDIR/new" >> $PM
chown $MYUSERNAME:$MYUSERNAME $PM
if ! grep -q "From: $EMAILADDRESS" $PM; then
echo "" >> $PM
echo ":0" >> $PM
echo " * ^From: $EMAILADDRESS" >> $PM
echo "$LISTDIR/new" >> $PM
chown $MYUSERNAME:$MYUSERNAME $PM
fi
if [ ! -f "$MUTTRC" ]; then
cp /etc/Muttrc $MUTTRC
chown $MYUSERNAME:$MYUSERNAME $MUTTRC

2
src/freedombone-addlist

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

Loading…
Cancel
Save