diff options
author | Marcello Coutinho <marcellocoutinho@gmail.com> | 2011-10-30 01:12:56 -0200 |
---|---|---|
committer | Marcello Coutinho <marcellocoutinho@gmail.com> | 2011-10-30 01:12:56 -0200 |
commit | f6eede1343ccddb6d6f504acb574e4ea05821116 (patch) | |
tree | 4182ab1cb2be9c7048a2e41167378571ac1d91b7 /config/pf-blocker | |
parent | a5f75afdd34f4d3938adc7acd924f06f3a7f3aef (diff) | |
download | pfsense-packages-f6eede1343ccddb6d6f504acb574e4ea05821116.tar.gz pfsense-packages-f6eede1343ccddb6d6f504acb574e4ea05821116.tar.bz2 pfsense-packages-f6eede1343ccddb6d6f504acb574e4ea05821116.zip |
pfBlocker - fix table reload and txt load file
Diffstat (limited to 'config/pf-blocker')
-rwxr-xr-x | config/pf-blocker/pfblocker.inc | 16 |
1 files 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{ |