diff options
author | keramida <keramida@FreeBSD.org> | 2002-12-07 23:37:44 +0000 |
---|---|---|
committer | keramida <keramida@FreeBSD.org> | 2002-12-07 23:37:44 +0000 |
commit | f973c892f02c9b9d8632f8a998cad3561c2aed82 (patch) | |
tree | a36b369e264e058212f540a3688cf59e2b033527 /etc/periodic/security/550.ipfwlimit | |
parent | 23261cad9face21241c2c9d8d9b3a6a5debda31e (diff) | |
download | FreeBSD-src-f973c892f02c9b9d8632f8a998cad3561c2aed82.zip FreeBSD-src-f973c892f02c9b9d8632f8a998cad3561c2aed82.tar.gz |
Avoid using perl in the periodic & security scripts. This brings the
base system one step closer to being totally perl-free.
Approved by: re (jhb)
Diffstat (limited to 'etc/periodic/security/550.ipfwlimit')
-rwxr-xr-x | etc/periodic/security/550.ipfwlimit | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/etc/periodic/security/550.ipfwlimit b/etc/periodic/security/550.ipfwlimit index 653dcf1..d033645 100755 --- a/etc/periodic/security/550.ipfwlimit +++ b/etc/periodic/security/550.ipfwlimit @@ -45,8 +45,10 @@ case "$daily_status_security_ipfwlimit_enable" in TMP=`mktemp ${TMPDIR:-/tmp}/security.XXXXXXXXXX` IPFW_LOG_LIMIT=`sysctl -n net.inet.ip.fw.verbose_limit 2> /dev/null` if [ $? -eq 0 ] && [ "${IPFW_LOG_LIMIT}" -ne 0 ]; then - ipfw -a l | grep " log " | perl -n -e \ - '/^\d+\s+(\d+)/; print if ($1 >= '$IPFW_LOG_LIMIT')' > ${TMP} + ipfw -a l | grep " log " | \ + grep '^[[:digit:]]\+[[:space:]]\+[[:digit:]]\+' | \ + awk -v limit="$IPFW_LOG_LIMIT" \ + '{if ($2 > limit) {print $0}}' > ${TMP} if [ -s "${TMP}" ]; then rc=1 echo "" |