From 1343d1b305e8b282c34fd6dfc7fea0fb83f452c0 Mon Sep 17 00:00:00 2001 From: David Spencer Date: Sun, 22 Feb 2015 16:53:35 +0000 Subject: network/snort: Updated for version 2.9.7.0. Signed-off-by: David Spencer --- network/snort/rc.snort | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'network/snort/rc.snort') diff --git a/network/snort/rc.snort b/network/snort/rc.snort index 9aaf410fcf..228e8da4e3 100644 --- a/network/snort/rc.snort +++ b/network/snort/rc.snort @@ -1,7 +1,7 @@ #!/bin/sh # Start/stop/restart snort -# This tell snort which interface to listen on (any for every interface) +# This tell snort which interface to listen on ("any" == every interface) IFACE=${IFACE:-any} # Make sure this matches your IFACE @@ -23,18 +23,22 @@ snort_start() { # Stop snort: snort_stop() { - echo -n "Stopping Snort daemon ($IFACE)..." - kill $(cat $PIDFILE) - echo - sleep 1 - rm -f $PIDFILE + if [ -f "$PIDFILE" ]; then + echo -n "Stopping Snort daemon (interface $IFACE)..." + kill $(cat $PIDFILE) + echo + sleep 1 + rm -f $PIDFILE + else + echo "Pidfile $PIDFILE not found!" + echo "Either Snort is not running or you should specify IFACE=xxxx" + exit 1 + fi } # Restart snort: snort_restart() { - snort_stop - sleep 1 - snort_start + snort_stop && sleep 1 && snort_start } case "$1" in -- cgit v1.2.3