aboutsummaryrefslogtreecommitdiffstats
path: root/config/snort/snort_pkg.sh
diff options
context:
space:
mode:
Diffstat (limited to 'config/snort/snort_pkg.sh')
-rw-r--r--config/snort/snort_pkg.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/config/snort/snort_pkg.sh b/config/snort/snort_pkg.sh
new file mode 100644
index 00000000..a19adf4d
--- /dev/null
+++ b/config/snort/snort_pkg.sh
@@ -0,0 +1,29 @@
+#!/usr/local/bin/php -f
+<?php
+require_once("/usr/local/pkg/snort/snort.inc");
+global $g;
+switch (strtolower($argv[1])) {
+ case "start":
+ if (!file_exists("{$g['varrun_path']}/snort_pkg_starting.lck")) {
+ touch("{$g['varrun_path']}/snort_pkg_starting.lck");
+ snort_start_all_interfaces();
+ unlink_if_exists("{$g['varrun_path']}/snort_pkg_starting.lck");
+ }
+ break;
+
+ case "stop":
+ snort_stop_all_interfaces();
+ unlink_if_exists("{$g['varrun_path']}/snort_pkg_starting.lck");
+ break;
+
+ case "restart":
+ snort_stop_all_interfaces();
+ touch("{$g['varrun_path']}/snort_pkg_starting.lck");
+ snort_start_all_interfaces();
+ unlink_if_exists("{$g['varrun_path']}/snort_pkg_starting.lck");
+ break;
+
+ default:
+ echo "WARNING: ignoring unsupported command - '{$argv[1]}'\n";
+}
+?>