diff options
author | robiscool <robrob2626@yahoo.com> | 2010-04-29 13:19:47 -0700 |
---|---|---|
committer | robiscool <robrob2626@yahoo.com> | 2010-04-29 13:19:47 -0700 |
commit | 949433f5a4f3ea37642aff112a9889f9c3e898da (patch) | |
tree | 47a590cebeb838fdeea9518fb04cf737ecb2f11f /config/snort/snort.inc | |
parent | 893ca7808324f0b3fc25f9d0261d713828455e92 (diff) | |
download | pfsense-packages-949433f5a4f3ea37642aff112a9889f9c3e898da.tar.gz pfsense-packages-949433f5a4f3ea37642aff112a9889f9c3e898da.tar.bz2 pfsense-packages-949433f5a4f3ea37642aff112a9889f9c3e898da.zip |
snort, add saved settings code to postinstall
Diffstat (limited to 'config/snort/snort.inc')
-rw-r--r-- | config/snort/snort.inc | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/config/snort/snort.inc b/config/snort/snort.inc index e03ec5d6..6348fd6e 100644 --- a/config/snort/snort.inc +++ b/config/snort/snort.inc @@ -635,7 +635,16 @@ function snort_postinstall() unset($config['installedpackages']['snortwhitelist']); unset($config['installedpackages']['snortthreshold']); unset($config['installedpackages']['snortadvanced']); - write_config(); + write_config(); + conf_mount_rw(); + + /* remake saved settings */ + if($config['installedpackages']['snortglobal']['forcekeepsettings'] == 'on') { + update_status(gettext("Saved settings detected...")); + update_output_window(gettext("Please wait... rebuilding files...")); + sync_snort_package_empty(); + update_output_window(gettext("Finnished Rebuilding files...")); + } conf_mount_ro(); @@ -1645,6 +1654,11 @@ function create_snort_conf($id, $if_real, $snort_uuid) /* write out snort.conf */ if ($if_real != '' && $snort_uuid != '') { + + if (!file_exists("/usr/local/etc/snort/snort_{$snort_uuid}_{$if_real}/snort.conf")) { + exec("/bin/mkdir /usr/local/etc/snort/snort_{$snort_uuid}_{$if_real}/"); + exec("/usr/bin/touch /usr/local/etc/snort/snort_{$snort_uuid}_{$if_real}/snort.conf"); + } $snort_conf_text = generate_snort_conf($id, $if_real, $snort_uuid); conf_mount_rw(); |