summaryrefslogtreecommitdiffstats
path: root/etc/periodic/security
diff options
context:
space:
mode:
authorkeramida <keramida@FreeBSD.org>2002-12-07 23:37:44 +0000
committerkeramida <keramida@FreeBSD.org>2002-12-07 23:37:44 +0000
commitf973c892f02c9b9d8632f8a998cad3561c2aed82 (patch)
treea36b369e264e058212f540a3688cf59e2b033527 /etc/periodic/security
parent23261cad9face21241c2c9d8d9b3a6a5debda31e (diff)
downloadFreeBSD-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')
-rwxr-xr-xetc/periodic/security/550.ipfwlimit6
-rwxr-xr-xetc/periodic/security/650.ip6fwlimit6
2 files changed, 8 insertions, 4 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 ""
diff --git a/etc/periodic/security/650.ip6fwlimit b/etc/periodic/security/650.ip6fwlimit
index 3a19c99..56cdf28 100755
--- a/etc/periodic/security/650.ip6fwlimit
+++ b/etc/periodic/security/650.ip6fwlimit
@@ -45,8 +45,10 @@ case "$daily_status_security_ip6fwlimit_enable" in
TMP=`mktemp ${TMPDIR:-/tmp}/security.XXXXXXXXXX`
IP6FW_LOG_LIMIT=`sysctl -n net.inet6.ip6.fw.verbose_limit 2> /dev/null`
if [ $? -eq 0 ] && [ "${IP6FW_LOG_LIMIT}" -ne 0 ]; then
- ip6fw -a l | grep " log " | perl -n -e \
- '/^\d+\s+(\d+)/; print if ($1 >= '$IP6FW_LOG_LIMIT')' > ${TMP}
+ ip6fw -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 ""
OpenPOWER on IntegriCloud