diff options
author | Dimitris Zlatanidis <d.zlatanidis@gmail.com> | 2014-12-17 14:58:47 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2014-12-17 14:58:47 +0700 |
commit | acbaed2e23d9063fdc62b91ce436ed683a51af37 (patch) | |
tree | 1f593b2ab154f21828d36dbd23d75ef05a744d1a /network/suricata/rc.suricata | |
parent | d46d4e3b4879c7980414b406b3b8d6d788acc81f (diff) | |
download | slackbuilds-acbaed2e23d9063fdc62b91ce436ed683a51af37.tar.gz |
network/suricata: Updated for version 2.0.5.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network/suricata/rc.suricata')
-rw-r--r-- | network/suricata/rc.suricata | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/network/suricata/rc.suricata b/network/suricata/rc.suricata new file mode 100644 index 0000000000..e4eb06f1a6 --- /dev/null +++ b/network/suricata/rc.suricata @@ -0,0 +1,53 @@ +#!/bin/sh +# Start/stop/restart suricata +# This file written from James Bond <evanton@tut.by> + +# This tell suricata which interface to listen on (any for every interface) +IFACE=${IFACE:-eth0} + +# Make sure this matches your IFACE +PIDFILE=/var/run/suricata_$IFACE.pid + +# You probably don't want to change this, but in case you do +LOGDIR="/var/log/suricata" + +# Probably not this either +CONF=/etc/suricata/suricata.yaml + +# Start suricata: +suricata_start() { + CMDLINE="/usr/bin/suricata -D -i $IFACE" + echo "Starting Suricata daemon: $CMDLINE" + $CMDLINE --pidfile $PIDFILE -l $LOGDIR -c $CONF + echo +} + +# Stop suricata: +suricata_stop() { + echo -n "Stopping Suricata daemon ($IFACE)..." + kill $(cat $PIDFILE) + echo + sleep 1 + rm -f $PIDFILE +} + +# Restart suricata: +suricata_restart() { + suricata_stop + sleep 1 + suricata_start +} + +case "$1" in +'start') + suricata_start + ;; +'stop') + suricata_stop + ;; +'restart') + suricata_restart + ;; +*) + echo "usage $0 start|stop|restart" +esac |