From f6eede1343ccddb6d6f504acb574e4ea05821116 Mon Sep 17 00:00:00 2001 From: Marcello Coutinho Date: Sun, 30 Oct 2011 01:12:56 -0200 Subject: pfBlocker - fix table reload and txt load file --- config/pf-blocker/pfblocker.inc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/config/pf-blocker/pfblocker.inc b/config/pf-blocker/pfblocker.inc index 1aa8a410..f9f6d951 100755 --- a/config/pf-blocker/pfblocker.inc +++ b/config/pf-blocker/pfblocker.inc @@ -138,7 +138,7 @@ function sync_package_pfblocker() { if ($row['format'] == "gz") $url_list= gzfile($row['url']); else - $url_list= file_get_contents($row['url']); + $url_list= file($row['url']); #extract range lists $new_file=""; foreach ($url_list as $line){ @@ -377,9 +377,21 @@ function sync_package_pfblocker() { if ($message == ""){ #save and apply all changes*/ + + #update pfctrl tables + $tables = array ('pfBlockerOutbound' => 'pfb_out.txt', + 'pfBlockerInbound' => 'pfb_in.txt', + 'pfBlockerWL' => 'pfb_w.txt'); + foreach ($tables as $table => $pfb_file) + exec("/sbin/pfctl -t " . escapeshellarg($table) . " -T replace -f /usr/local/pkg/" . escapeshellarg($pfb_file) . " 2>&1", $result_pfb); + + #write config write_config(); - #load filter file after editing + + #load filter file after editing filter_configure(); + + #sync config pfblocker_sync_on_changes(); } else{ -- cgit v1.2.3