Improved spamcheck and thereby donaspam and adspam
This commit is contained in:
@@ -3,11 +3,18 @@
|
||||
# Maintainer: peignerpausz
|
||||
|
||||
printf '=== %s Spamcheck === \n' "$(hostname)"
|
||||
found_errors=0
|
||||
for a in S3150 S775 S7771 S7772 S7773 S7774 S7775 S7776 S7777 S7778 S7779 Spamhaus
|
||||
do
|
||||
count=$(sudo grep -c "\($a\)" /var/log/maillog 2>/dev/null)
|
||||
count=${count//$'\r'/}
|
||||
count=${count//[^0-9]/}
|
||||
count=${count:-0}
|
||||
if [ "$count" -gt 0 ]; then
|
||||
printf "|=> Anzahl %s: %s\n" "$a" "$count"
|
||||
printf "❌ Anzahl %s: %s\n" "$a" "$count"
|
||||
found_errors=1
|
||||
fi
|
||||
done
|
||||
printf '=== %s Spamcheck done === \n' "$(hostname)"
|
||||
if [ "$found_errors" -eq 0 ]; then
|
||||
printf "✅ All systems green.\n"
|
||||
fi
|
||||
Reference in New Issue
Block a user