#! /bin/sh # Copyright (c) 1995-2000 SuSE, Germany. # # Author: Matthias Eckermann, SuSE Linux Solutions AG # # /etc/rc.d/snort # # snort This shell script takes care of starting and stopping # snort packet-sniffer/logger. # . /etc/rc.config # Determine the base and follow a runlevel link name. base=${0##*/} link=${base#*[SK][0-9][0-9]} # Force execution if not called by a runlevel directory. test $link = $base && START_SNORT=yes test "$START_SNORT" = yes || exit 0 # The echo return value for success (defined in /etc/rc.config). return=$rc_done case "$1" in start) echo -n "Starting snort: " startproc /usr/local/bin/snort -dev -l /var/log/snort -c /etc/snort/snort-lib -D || return=$rc_failed echo -e "$return" ;; stop) echo -n "Shutting down snort" killproc -TERM /usr/local/bin/snort || return=$rc_failed echo -e "$return" ;; restart) $0 stop && $0 start || return=$rc_failed ;; *) echo "Usage: $0 {start|stop|status|restart}" exit 1 ;; esac # Inform the caller not only verbosely and set an exit status. test "$return" = "$rc_done" || exit 1 exit 0