diff options
author | Seth Mos <seth.mos@dds.nl> | 2011-01-26 12:53:20 +0100 |
---|---|---|
committer | Seth Mos <seth.mos@dds.nl> | 2011-01-26 12:53:20 +0100 |
commit | 7de4359aa06f2e04e2a4f38399ef9c2817dbdf16 (patch) | |
tree | 99797751ed0e3e7419490cf0baaba33ddc9b938d /etc/rc.update_bogons.sh | |
parent | b0538842600fe7bd8af9124d637a31c232ccc35d (diff) | |
download | pfsense-7de4359aa06f2e04e2a4f38399ef9c2817dbdf16.zip pfsense-7de4359aa06f2e04e2a4f38399ef9c2817dbdf16.tar.gz |
Add the bogonsv6 table for the IPv6 bogons
Diffstat (limited to 'etc/rc.update_bogons.sh')
-rwxr-xr-x | etc/rc.update_bogons.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/etc/rc.update_bogons.sh b/etc/rc.update_bogons.sh index 52cfc1a..52ec92f 100755 --- a/etc/rc.update_bogons.sh +++ b/etc/rc.update_bogons.sh @@ -28,6 +28,15 @@ if [ ! -f /tmp/bogons ]; then exit fi +/usr/bin/fetch -q -o /tmp/bogonsv6 "http://files.pfsense.org/mirrors/fullbogons-ipv6.txt" +if [ ! -f /tmp/bogonsv6 ]; then + echo "Could not download http://files.pfsense.org/mirrors/fullbogons-ipv6.txt" | logger + # Relaunch and sleep + sh /etc/rc.update_bogons.sh & + exit +fi + + BOGON_MD5=`/usr/bin/fetch -q -o - "http://files.pfsense.org/mirrors/bogon-bn-nonagg.txt.md5" | awk '{ print $4 }'` ON_DISK_MD5=`md5 /tmp/bogons | awk '{ print $4 }'` if [ "$BOGON_MD5" = "$ON_DISK_MD5" ]; then @@ -42,5 +51,19 @@ else sh /etc/rc.update_bogons.sh & fi +BOGON_MD5=`/usr/bin/fetch -q -o - "http://files.pfsense.org/mirrors/fullbogons-ipv6.txt.md5" | awk '{ print $4 }'` +ON_DISK_MD5=`md5 /tmp/bogonsv6 | awk '{ print $4 }'` +if [ "$BOGON_MD5" = "$ON_DISK_MD5" ]; then + egrep -v "^#" /tmp/bogonsv6 > /etc/bogonsv6 + /etc/rc.conf_mount_ro + RESULT=`/sbin/pfctl -t bogonsv6 -T replace -f /etc/bogonsv6 2>&1` + rm /tmp/bogons + echo "Bogons files downloaded: $RESULT" | logger +else + echo "Could not download http://files.pfsense.org/mirrors/fullbogons-ipv6.txt.md5 (md5 mismatch)" | logger + # Relaunch and sleep + sh /etc/rc.update_bogons.sh & +fi + echo "rc.update_bogons.sh is ending the update cycle." | logger |