Replace sed(1) with perl(1). The 4.4BSD sed programm is
200 times slower than perl or SunOS 5.5.1 sed.
This commit is contained in:
parent
c3aba9f5d2
commit
0729b6bb89
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# $Id: 460.status-mail-rejects,v 1.3 1998/01/23 01:58:18 brian Exp $
|
||||
# $Id: 460.status-mail-rejects,v 1.4 1998/01/26 02:26:29 brian Exp $
|
||||
#
|
||||
|
||||
if [ -d /etc/mail -a -f /var/log/maillog ]; then
|
||||
@ -8,9 +8,9 @@ if [ -d /etc/mail -a -f /var/log/maillog ]; then
|
||||
echo Checking for rejected mail hosts:
|
||||
|
||||
start=`date -v-1d '+%b %d' | sed 's/0\(.\)$/ \1/'`
|
||||
zcat -fc /var/log/maillog.0* /var/log/maillog |
|
||||
sed -n \
|
||||
-e "s/^$start.*ruleset=check_mail, arg1=<.*@\\([^>]*\\)>.*reject=.*/ \\1/p" \
|
||||
-e "s/^$start.*ruleset=check_relay, arg1=\\([^, ]*\\), .*reject=.*/ \\1/p" |
|
||||
sort -u
|
||||
zcat -fc /var/log/maillog.0* /var/log/maillog | grep reject= |
|
||||
perl -ne "print \"\$1\n\"
|
||||
if (/^$start.*ruleset=check_mail, arg1=<.*@([^>]*)>.*reject=/o ||
|
||||
/^$start.*ruleset=check_relay, arg1=([^, ]*), .*reject=/o)" |
|
||||
sort -u
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user