Revision 38b65b80
Added by Scott Ullrich over 17 years ago
- Download bogons entries from pfsense.com
- Do not update on every minute on the 1st of the month
- Sleep for a random period before updating to avoid killing the server
etc/rc.update_bogons.sh | ||
---|---|---|
4 | 4 |
# Part of the pfSense project |
5 | 5 |
# www.pfsense.com |
6 | 6 |
|
7 |
# Grab a random value between 0-999. |
|
8 |
value=$RANDOM |
|
9 |
while [ $value -gt 999 ] ; do |
|
10 |
value=$RANDOM |
|
11 |
done |
|
12 |
|
|
13 |
# Sleep for that time. |
|
14 |
sleep $value |
|
15 |
|
|
7 | 16 |
/etc/rc.conf_mount_rw |
8 |
/usr/bin/fetch -q -o /tmp/bogons "http://www.cymru.com/Documents/bogon-bn-nonagg.txt"
|
|
17 |
/usr/bin/fetch -q -o /tmp/bogons "http://www.pfsense.com/mirrors/bogon-bn-nonagg.txt"
|
|
9 | 18 |
egrep -v "^192.168.0.0/16|^172.16.0.0/12|^10.0.0.0/8" /tmp/bogons > /etc/bogons |
10 | 19 |
/etc/rc.conf_mount_ro |
11 | 20 |
/sbin/pfctl -t bogons -T replace -f /etc/bogons |
Also available in: Unified diff