From dfc954431b9d7bdb08611751ec769147e678a2b2 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 1 Oct 2006 00:46:15 +0000 Subject: require_once() /usr/local/pkg/pf/ files --- etc/inc/filter.inc | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) (limited to 'etc/inc') diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index 42e88b4..ac25f07 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -73,7 +73,7 @@ function filter_configure_sync() { global $config, $g, $after_filter_configure_run; update_filter_reload_status("Initializing"); /* invalidate interface cache */ - get_interface_arr(true); + get_interface_arr(true); if(isset($config['system']['developerspew'])) { $mt = microtime(); echo "filter_configure_sync() being called $mt\n"; @@ -146,7 +146,6 @@ function filter_configure_sync() { } $rules .= "\n"; - update_filter_reload_status("Setting up SCRUB information"); /* get our wan interface? */ $wanif = get_real_wan_interface(); @@ -203,6 +202,17 @@ function filter_configure_sync() { unlink_if_exists("/usr/local/pkg/pf/carp_sync_client.php"); + /* run items scheduled for after filter configure run */ + foreach($after_filter_configure_run as $afcr) { + $fda = fopen("/tmp/commands.txt", "w"); + fwrite($fda, $afcr . "\n"); + fclose($fda); + } + if(file_exists("/tmp/commands.txt")) { + mwexec("sh /tmp/commands.txt &"); + unlink("/tmp/commands.txt"); + } + update_filter_reload_status("Running plugins"); /* process packager manager custom rules */ @@ -218,37 +228,25 @@ function filter_configure_sync() { if(!stristr($file,"CVS")) { if($g['booting'] == true) echo "\t{$file}... "; - eval($text); + require_once("/usr/local/pkg/pf/" . $file); } } } } } } + update_filter_reload_status("Plugins completed."); /* we need a way to let a user run a shell cmd after each filter_configure() call. run this xml command after each change. */ - if($config['system']['afterfilterchangeshellcmd'] <> "") { + if($config['system']['afterfilterchangeshellcmd'] <> "") mwexec($config['system']['afterfilterchangeshellcmd']); - } - - /* run items scheduled for after filter configure run */ - foreach($after_filter_configure_run as $afcr) { - $fda = fopen("/tmp/commands.txt", "w"); - fwrite($fda, $afcr . "\n"); - fclose($fda); - } - if(file_exists("/tmp/commands.txt")) { - mwexec("sh /tmp/commands.txt &"); - unlink("/tmp/commands.txt"); - } - - update_filter_reload_status("Syncing CARP data"); /* sync carp entries to other firewalls */ + update_filter_reload_status("Syncing CARP data"); carp_sync_client(); update_filter_reload_status("Done"); -- cgit v1.1