minor alerts improvements
[distro-setup] / mailtest-check
index cd12bc7b3738ff47d775d27ec9f444974d6d2359..466908d30c55a92b32cac3b92f8f0bba1fb30f4a 100755 (executable)
@@ -76,13 +76,14 @@ esac
 
 getspamdpid() {
   if [[ ! $spamdpid || ! -d /proc/$spamdpid ]]; then
-    spamdpid=$(systemctl status spamassassin| sed -n '/^ *Main PID:/s/[^0-9]//gp')
+    spamdpid=$(systemctl status spamassassin| sed -n '/^ *Main PID:/s/[^0-9]//gp' ||:)
   fi
 }
 getspamdpid
 e spamdpid: $spamdpid
 if [[ ! $spamdpid ]]; then
-  echo $HOSTNAME mailtest spamd pid not found
+  echo $HOSTNAME mailtest spamd pid not found. systemctl status spamassassin:
+  systemctl status spamassassin
 fi
 tmpfile=$(mktemp)
 for folder in ${folders[@]}; do