|
@@ -1193,9 +1193,24 @@ function spam_filtering {
|
1193
|
1193
|
# this must be accessible by root
|
1194
|
1194
|
chown -R $MY_USERNAME:root /home/$MY_USERNAME/.spamassassin
|
1195
|
1195
|
|
|
1196
|
+ # script to keep spamassassin running
|
|
1197
|
+ # There is a systemd script from the debian package, but it doesn't restart on failure
|
|
1198
|
+ # and also doesn't ensure start after networking is up. If that is eventually fixed
|
|
1199
|
+ # then this script and the cron job which runs it can be removed.
|
|
1200
|
+ script_name=/usr/bin/run-spamassassin
|
|
1201
|
+ echo '#!/bin/bash' > $script_name
|
|
1202
|
+ echo 'current_state=$(systemctl status spamassassin)' >> $script_name
|
|
1203
|
+ echo 'if [[ "$current_state" != *"(running)"* ]]; then' >> $script_name
|
|
1204
|
+ echo ' systemctl restart spamassassin' >> $script_name
|
|
1205
|
+ echo 'fi' >> $script_name
|
|
1206
|
+ echo 'exit 0' >> $script_name
|
|
1207
|
+ chmod +x $script_name
|
|
1208
|
+
|
1196
|
1209
|
systemctl start spamassassin
|
1197
|
1210
|
systemctl restart exim4
|
1198
|
1211
|
systemctl restart cron
|
|
1212
|
+ function_check cron_add_mins
|
|
1213
|
+ cron_add_mins 10 "$script_name 2> /dev/null"
|
1199
|
1214
|
|
1200
|
1215
|
mark_completed $FUNCNAME
|
1201
|
1216
|
}
|