summaryrefslogtreecommitdiffstats
path: root/etc/rc.update_bogons.sh
diff options
context:
space:
mode:
authorphildd <ict.advisor@nepal.inf.org>2013-03-25 16:23:44 +0545
committerphildd <ict.advisor@nepal.inf.org>2013-03-25 16:23:44 +0545
commit8550a21c2bb336dba3e992754f5fa241e3b0ad2d (patch)
tree47a8020aab3d59d38fc6eb969ddc88dcf1ec79ba /etc/rc.update_bogons.sh
parentc858c609b218bdaef64f1a14f5fe483837779477 (diff)
downloadpfsense-8550a21c2bb336dba3e992754f5fa241e3b0ad2d.zip
pfsense-8550a21c2bb336dba3e992754f5fa241e3b0ad2d.tar.gz
Improve bogonsv6 checks during update
Improvements to using pfctl to check the existence of the bogonsv6 table.
Diffstat (limited to 'etc/rc.update_bogons.sh')
-rwxr-xr-xetc/rc.update_bogons.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/etc/rc.update_bogons.sh b/etc/rc.update_bogons.sh
index 8761be9..64b9075 100755
--- a/etc/rc.update_bogons.sh
+++ b/etc/rc.update_bogons.sh
@@ -113,10 +113,10 @@ if [ "$BOGON_V4_CKSUM" = "$ON_DISK_V4_CKSUM" ] || [ "$BOGON_V6_CKSUM" = "$ON_DIS
fi
if [ "$BOGON_V6_CKSUM" = "$ON_DISK_V6_CKSUM" ]; then
- BOGONS_V6=`pfctl -sTables | grep bogonsv6`
+ BOGONS_V6_TABLE_COUNT=`pfctl -sTables | grep ^bogonsv6$ | wc -l | awk '{ print $1 }'`
ENTRIES_TOT=`pfctl -vvsTables | awk '/Addresses/ {s+=$2}; END {print s}'`
LINES_V6=`wc -l /tmp/bogonsv6 | awk '{ print $1 }'`
- if [ "$BOGONS_V6" = "bogonsv6" ]; then
+ if [ $BOGONS_V6_TABLE_COUNT -gt 0 ]; then
ENTRIES_V6=`pfctl -vvsTables | awk '/-\tbogonsv6$/ {getline; print $2}'`
if [ $ENTRIES_MAX -gt $((2*ENTRIES_TOT-${ENTRIES_V6:-0}+LINES_V6)) ]; then
egrep -v "^fc00::/7" /tmp/bogonsv6 > /etc/bogonsv6
OpenPOWER on IntegriCloud