aboutsummaryrefslogtreecommitdiffstats
path: root/config/snort/snort_pkg.sh
diff options
context:
space:
mode:
authorbmeeks8 <bmeeks8@bellsouth.net>2014-09-18 21:13:23 -0400
committerbmeeks8 <bmeeks8@bellsouth.net>2014-09-18 21:13:23 -0400
commitb3690f7345eb7f2dc0b5832972f9793eeb63c5c5 (patch)
tree2409a0683c94ade9ba18fa81a355ddc3ed0f6bec /config/snort/snort_pkg.sh
parentce738579b75249da4758f63628206a859ca44e4f (diff)
downloadpfsense-packages-b3690f7345eb7f2dc0b5832972f9793eeb63c5c5.tar.gz
pfsense-packages-b3690f7345eb7f2dc0b5832972f9793eeb63c5c5.tar.bz2
pfsense-packages-b3690f7345eb7f2dc0b5832972f9793eeb63c5c5.zip
Add new shell script for starting Snort package.
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";
+}
+?>