lots of fixes, improvements, t12 stuff
[distro-setup] / epanic-clean
index c171746cc41f848eeed9c9d09d525e7feda34d18..c9739ba6d8474516e2c71fd1237f3665cb5527dc 100755 (executable)
@@ -50,6 +50,11 @@ v() {
   fi
 }
 
+spamd_ser=spamd
+if systemctl cat spamassassin &>/dev/null; then
+  spamd_ser=spamassassin
+fi
+
 
 pl=/var/log/exim4/paniclog
 main() {
@@ -108,7 +113,7 @@ main() {
       jmax="$(date -d @$sec_max "+%F %H:%M:%S")"
       description=$(systemctl cat $service | sed -rn 's/^ *Description=(.*)/\1/p')
       jrregex="^Starting $description"
-      if [[ $service == spamassassin ]]; then
+      if [[ $service == "$spamd_ser" ]]; then
         jrregex+="\|^spamd: restarting"
       fi
       d "jrregex=$jrregex jmin=$jmin jmax=$jmax"
@@ -129,9 +134,9 @@ main() {
         sed -ri "/$regex/d" $pl
       fi
     fi
-  done <<'EOF'
+  done <<EOF
 clamav-daemon malware acl condition
-spamassassin spam acl condition
+$spamd_ser spam acl condition
 EOF
   ### end removing panic lines due to service restarts ###