diff options
author | Chris Buechler <cmb@pfsense.org> | 2009-08-20 17:21:43 -0400 |
---|---|---|
committer | Chris Buechler <cmb@pfsense.org> | 2009-08-20 17:21:43 -0400 |
commit | 9dbb93ba9de282429f35d82f052624e79c6e49c8 (patch) | |
tree | 7347495938d9836541b696a1f814354d8f527dde | |
parent | d114f3e337129cf7be5ba60ca09cad585be22434 (diff) | |
download | pfsense-9dbb93ba9de282429f35d82f052624e79c6e49c8.zip pfsense-9dbb93ba9de282429f35d82f052624e79c6e49c8.tar.gz |
Fix bogons update in GUI without duplicating logic
-rwxr-xr-x | etc/rc.update_bogons.sh | 11 | ||||
-rw-r--r-- | usr/local/www/diag_showbogons.php | 7 |
2 files changed, 6 insertions, 12 deletions
diff --git a/etc/rc.update_bogons.sh b/etc/rc.update_bogons.sh index 332aeb7..d07cfb9 100755 --- a/etc/rc.update_bogons.sh +++ b/etc/rc.update_bogons.sh @@ -7,13 +7,12 @@ echo "rc.update_bogons.sh is starting up." | logger # Sleep for that time, unless an argument is specified. + if [ "$1" = "" ]; then - if [ ! -f /var/run/donotsleep_bogons ]; then - # Grab a random value - value=`od -A n -d -N2 /dev/random | awk '{ print $1 }'` - echo "rc.update_bogons.sh is sleeping for $value" | logger - sleep $value - fi + # Grab a random value + value=`od -A n -d -N2 /dev/random | awk '{ print $1 }'` + echo "rc.update_bogons.sh is sleeping for $value" | logger + sleep $value fi echo "rc.update_bogons.sh is beginning the update cycle." | logger diff --git a/usr/local/www/diag_showbogons.php b/usr/local/www/diag_showbogons.php index b8366db..c3ee290 100644 --- a/usr/local/www/diag_showbogons.php +++ b/usr/local/www/diag_showbogons.php @@ -37,12 +37,7 @@ require("guiconfig.inc"); if($_POST['Download']) { - exec("touch /var/run/donotsleep_bogons"); - conf_mount_rw(); - exec("/usr/bin/fetch -q -o /tmp/bogons 'http://files.pfsense.org/bogon-bn-nonagg.txt'"); - if(file_exists("/tmp/bogons")) - exec("egrep -v '^192.168.0.0/16|^172.16.0.0/12|^10.0.0.0/8' /tmp/bogons > /etc/bogons"); - exec("rm /tmp/bogons"); + mwexec_bg("/etc/rc.update_bogons.sh now"); } $bogons = `cat /etc/bogons`; |