diff options
author | marcelloc <marcellocoutinho@gmail.com> | 2011-11-11 20:13:20 -0200 |
---|---|---|
committer | marcelloc <marcellocoutinho@gmail.com> | 2011-11-11 20:13:20 -0200 |
commit | f647defe0be64a7d73c3f991e865ac9948d89c34 (patch) | |
tree | 6285ae496f6a42308793984c10d59b6939c9de69 | |
parent | 856d4ce775e4ef1863b6c0e5106d86a2510553ea (diff) | |
download | pfsense-packages-f647defe0be64a7d73c3f991e865ac9948d89c34.tar.gz pfsense-packages-f647defe0be64a7d73c3f991e865ac9948d89c34.tar.bz2 pfsense-packages-f647defe0be64a7d73c3f991e865ac9948d89c34.zip |
pfBlocker - Fix update_frequency cron call
-rwxr-xr-x | config/pf-blocker/pfblocker.inc | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/config/pf-blocker/pfblocker.inc b/config/pf-blocker/pfblocker.inc index 95642d62..fcaad65f 100755 --- a/config/pf-blocker/pfblocker.inc +++ b/config/pf-blocker/pfblocker.inc @@ -445,22 +445,31 @@ function sync_package_pfblocker() { if ($message == ""){ #check cron $cron_found=0; + $cron_cmd="/usr/local/bin/php -q /usr/local/www/pfblocker.php cron"; if (is_array($config['cron']['item'])){ $new_cron=array(); foreach($config['cron']['item'] as $cron){ - if ($cron["command"] == "/usr/local/www/pfblocker.php cron") - $cron_found=1; - $new_cron['item'][]=$cron; + if (preg_match("/usr.local.www.pfblocker.php cron/",$cron["command"])){ + #fix 0.1.4.6 missing php path + if($cron["command"]==$cron_cmd && $pfblocker_enable == "on"){ + $new_cron['item'][]=$cron; + $cron_found=1; + } + } + else{ + $new_cron['item'][]=$cron; + } } if ($cron_found == 0){ - $new_cron['item'][]=array( "minute" => "0", - "hour" => "*", - "mday" => "*", - "month" => "*", - "wday" => "*", - "who" => "root", - "command"=> "/usr/local/www/pfblocker.php cron"); - $config['cron']=$new_cron; + if($pfblocker_enable == "on") + $new_cron['item'][]=array( "minute" => "0", + "hour" => "*", + "mday" => "*", + "month" => "*", + "wday" => "*", + "who" => "root", + "command"=> $cron_cmd); + $config['cron']=$new_cron; } } |