diff options
author | Ermal Luçi <eri@pfsense.org> | 2009-08-11 10:14:15 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2009-08-11 10:23:46 +0000 |
commit | 4fea01e0065e6750814a424bcd52eebf8359133c (patch) | |
tree | b543b72150e280134dac94c1e42520fe47192286 /etc/inc | |
parent | 7f9bd1c25b9696c09b2a850d0ed5a3152b883ba6 (diff) | |
download | pfsense-4fea01e0065e6750814a424bcd52eebf8359133c.zip pfsense-4fea01e0065e6750814a424bcd52eebf8359133c.tar.gz |
Use the global variable for referencing tmp path and do not use hardcoded value.
Diffstat (limited to 'etc/inc')
-rw-r--r-- | etc/inc/filter.inc | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index 741cf9c..079aad6 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -292,20 +292,24 @@ function filter_configure_sync() { layer7_start_l7daemon(); /* run items scheduled for after filter configure run */ - $fda = fopen("/tmp/commands.txt", "w"); - foreach($after_filter_configure_run as $afcr) - fwrite($fda, $afcr . "\n"); - /* - * 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'] <> "") - fwrite($fda, $config['system']['afterfilterchangeshellcmd'] . "\n"); - fclose($fda); - if (file_exists("/tmp/commands.txt")) { - mwexec("sh /tmp/commands.txt &"); - unlink("/tmp/commands.txt"); + $fda = fopen("{$g['tmp_path']}/commands.txt", "w"); + if ($fda) { + foreach($after_filter_configure_run as $afcr) + fwrite($fda, $afcr . "\n"); + /* + * 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'] <> "") + fwrite($fda, $config['system']['afterfilterchangeshellcmd'] . "\n"); + + fclose($fda); + } + + if (file_exists("{$g['tmp_path']}/commands.txt")) { + mwexec("sh {$g['tmp_path']}/commands.txt &"); + unlink("{$g['tmp_path']}/commands.txt"); } /* if time based rules are enabled then swap in the set */ if ($time_based_rules == true) |