From b3dcf0e172dccaefddff4dcf225f9ce75c6e95e7 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 4 Jan 2016 16:01:31 +0000 Subject: [PATCH] Check that spamassassin is installed --- src/freedombone | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/freedombone b/src/freedombone index 115b9222..cf1fed6d 100755 --- a/src/freedombone +++ b/src/freedombone @@ -4455,6 +4455,10 @@ function spam_filtering { apt-get -y install exim4-daemon-heavy apt-get -y install spamassassin sa-update -v + if [ ! -f /etc/default/spamassassin ]; then + echo 'Spamassassin was not installed' + exit 72570 + fi sed -i 's/ENABLED=0/ENABLED=1/g' /etc/default/spamassassin sed -i 's/# spamd_address = 127.0.0.1 783/spamd_address = 127.0.0.1 783/g' /etc/exim4/exim4.conf.template # This configuration is based on https://wiki.debian.org/DebianSpamAssassin @@ -4598,9 +4602,9 @@ function spam_filtering { # this must be accessible by root chown -R $MY_USERNAME:root /home/$MY_USERNAME/.spamassassin - service spamassassin restart - service exim4 restart - service cron restart + systemctl restart spamassassin + systemctl restart exim4 + systemctl restart cron echo 'spam_filtering' >> $COMPLETION_FILE } @@ -5648,7 +5652,7 @@ function install_web_server { if grep -q "Nginx-ensite commit" $COMPLETION_FILE; then CURRENT_NGINX_ENSITE_COMMIT=$(grep "Nginx-ensite commit" $COMPLETION_FILE | awk -F ':' '{print $2}') if [[ "$CURRENT_NGINX_ENSITE_COMMIT" != "$NGINX_ENSITE_COMMIT" ]]; then - $INSTALL_DIR/nginx_ensite + $INSTALL_DIR/nginx_ensite git stash git checkout master git pull