$i) { if ($i['name'] == $autolist) { unset($config['installedpackages']['snortglobal']['suppress']['item'][$k]); break; } } // Finally delete the interface's config entry entirely unset($a_nat[$rulei]); } conf_mount_ro(); /* If all the Snort interfaces are removed, then unset the config array. */ if (empty($a_nat)) unset($a_nat); write_config(); sleep(2); /* if there are no ifaces remaining do not create snort.sh */ if (!empty($config['installedpackages']['snortglobal']['rule'])) snort_create_rc(); else { conf_mount_rw(); @unlink('/usr/local/etc/rc.d/snort.sh'); conf_mount_ro(); } sync_snort_package_config(); header( 'Expires: Sat, 26 Jul 1997 05:00:00 GMT' ); header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' ); header( 'Cache-Control: no-store, no-cache, must-revalidate' ); header( 'Cache-Control: post-check=0, pre-check=0', false ); header( 'Pragma: no-cache' ); header("Location: /snort/snort_interfaces.php"); exit; } } /* start/stop snort */ if ($_GET['act'] == 'bartoggle' && is_numeric($id)) { $snortcfg = $config['installedpackages']['snortglobal']['rule'][$id]; $if_real = snort_get_real_interface($snortcfg['interface']); $if_friendly = snort_get_friendly_interface($snortcfg['interface']); if (snort_is_running($snortcfg['uuid'], $if_real, 'barnyard2') == 'no') { log_error("Toggle (barnyard starting) for {$if_friendly}({$snortcfg['descr']})..."); sync_snort_package_config(); snort_barnyard_start($snortcfg, $if_real); } else { log_error("Toggle (barnyard stopping) for {$if_friendly}({$snortcfg['descr']})..."); snort_barnyard_stop($snortcfg, $if_real); } sleep(3); // So the GUI reports correctly header("Location: /snort/snort_interfaces.php"); exit; } /* start/stop snort */ if ($_GET['act'] == 'toggle' && is_numeric($id)) { $snortcfg = $config['installedpackages']['snortglobal']['rule'][$id]; $if_real = snort_get_real_interface($snortcfg['interface']); $if_friendly = snort_get_friendly_interface($snortcfg['interface']); if (snort_is_running($snortcfg['uuid'], $if_real) == 'yes') { log_error("Toggle (snort stopping) for {$if_friendly}({$snortcfg['descr']})..."); snort_stop($snortcfg, $if_real); header( 'Expires: Sat, 26 Jul 1997 05:00:00 GMT' ); header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' ); header( 'Cache-Control: no-store, no-cache, must-revalidate' ); header( 'Cache-Control: post-check=0, pre-check=0', false ); header( 'Pragma: no-cache' ); } else { log_error("Toggle (snort starting) for {$if_friendly}({$snortcfg['descr']})..."); /* set flag to rebuild interface rules before starting Snort */ $rebuild_rules = "on"; sync_snort_package_config(); $rebuild_rules = "off"; snort_start($snortcfg, $if_real); header( 'Expires: Sat, 26 Jul 1997 05:00:00 GMT' ); header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' ); header( 'Cache-Control: no-store, no-cache, must-revalidate' ); header( 'Cache-Control: post-check=0, pre-check=0', false ); header( 'Pragma: no-cache' ); } sleep(3); // So the GUI reports correctly header("Location: /snort/snort_interfaces.php"); exit; } $pgtitle = "Services: $snort_package_version"; include_once("head.inc"); ?>
' . $pgtitle . ''; ?>