Pārlūkot izejas kodu

Avoid duplicates

Bob Mottram 11 gadus atpakaļ
vecāks
revīzija
53f8aa5563
1 mainītis faili ar 6 papildinājumiem un 2 dzēšanām
  1. 6
    2
      install-freedombone.sh

+ 6
- 2
install-freedombone.sh Parādīt failu

@@ -763,8 +763,12 @@ function spam_filtering {
763 763
   echo '    rm "$MAILDIR/new/$f"' >> /usr/bin/filterham
764 764
   echo 'done' >> /usr/bin/filterham
765 765
 
766
-  echo "*/3 * * * * root /usr/bin/timeout 120 /usr/bin/filterspam $MY_USERNAME" >> /etc/crontab
767
-  echo "*/3 * * * * root /usr/bin/timeout 120 /usr/bin/filterham $MY_USERNAME" >> /etc/crontab
766
+  if ! grep -q "filterspam" /etc/crontab; then
767
+    echo "*/3 * * * * root /usr/bin/timeout 120 /usr/bin/filterspam $MY_USERNAME" >> /etc/crontab
768
+  fi
769
+  if ! grep -q "filterham" /etc/crontab; then
770
+    echo "*/3 * * * * root /usr/bin/timeout 120 /usr/bin/filterham $MY_USERNAME" >> /etc/crontab
771
+  fi
768 772
   chmod 655 /usr/bin/filterspam /usr/bin/filterham
769 773
   sed -i 's/# use_bayes 1/use_bayes 1/g' /etc/mail/spamassassin/local.cf
770 774
   sed -i 's/# bayes_auto_learn 1/bayes_auto_learn 1/g' /etc/mail/spamassassin/local.cf