aboutsummaryrefslogtreecommitdiffstats
path: root/config/pf-blocker/pfblocker.inc
diff options
context:
space:
mode:
authormarcelloc <marcellocoutinho@gmail.com>2011-11-11 20:13:20 -0200
committermarcelloc <marcellocoutinho@gmail.com>2011-11-11 20:13:20 -0200
commitf647defe0be64a7d73c3f991e865ac9948d89c34 (patch)
tree6285ae496f6a42308793984c10d59b6939c9de69 /config/pf-blocker/pfblocker.inc
parent856d4ce775e4ef1863b6c0e5106d86a2510553ea (diff)
downloadpfsense-packages-f647defe0be64a7d73c3f991e865ac9948d89c34.tar.gz
pfsense-packages-f647defe0be64a7d73c3f991e865ac9948d89c34.tar.bz2
pfsense-packages-f647defe0be64a7d73c3f991e865ac9948d89c34.zip
pfBlocker - Fix update_frequency cron call
Diffstat (limited to 'config/pf-blocker/pfblocker.inc')
-rwxr-xr-xconfig/pf-blocker/pfblocker.inc31
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;
}
}