diff options
author | brian <brian@FreeBSD.org> | 2005-01-11 01:47:44 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2005-01-11 01:47:44 +0000 |
commit | db72d98ac137d32b12ac2d2064b0d5faec4567a3 (patch) | |
tree | bbbc823f19733a653498fb11b2f5beed601d1332 /etc/periodic/daily | |
parent | 580248c6b5cd3aadd2c92bf157c02d6ed1f9871a (diff) | |
download | FreeBSD-src-db72d98ac137d32b12ac2d2064b0d5faec4567a3.zip FreeBSD-src-db72d98ac137d32b12ac2d2064b0d5faec4567a3.tar.gz |
Collapse "fgrep | egrep | sed" down to a single sed.
This also trims extraneous commas from domain names.
MFC after: 7 days
Diffstat (limited to 'etc/periodic/daily')
-rwxr-xr-x | etc/periodic/daily/460.status-mail-rejects | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/etc/periodic/daily/460.status-mail-rejects b/etc/periodic/daily/460.status-mail-rejects index 34f1df2..fa95d8c 100755 --- a/etc/periodic/daily/460.status-mail-rejects +++ b/etc/periodic/daily/460.status-mail-rejects @@ -51,9 +51,7 @@ case "$daily_status_mail_rejects_enable" in done cat /var/log/maillog } | - fgrep 'reject=' | - egrep -e "^$start.*ruleset=check_[^[:space:]]+,[[:space:]]+arg1=(<[^@]+@)?([^>,]+).*reject=.*" | - sed -e 's/.*arg1=//' -e 's/.*@//' -e 's/[>[:space:]].*$//' | + sed -n -E "s/^$start"'.*ruleset=check_[^ ]+,[ ]+arg1=(<[^@]+@)?([^>,]+).*reject=.*/\2/p' | sort -f | uniq -ic | sort -fnr | tee /dev/stderr | wc -l) [ $rc -gt 0 ] && rc=1 fi;; |