#! /bin/bash # snort start script # chkconfig:35 90 90 # description:snort is IDS system # Source function library. . /etc/init.d/functions #program name snort=/usr/local/bin/snort prog=snort RETVAL=0 start() { echo -n $"Starting $prog:" daemon $snort -c /etc/snort/snort.conf -u snort -g snort -Dde -l /var/log/snort/ RETVAL=$? echo return $RETVAL } stop() { echo -n "Stopping $prog:" killproc $snort RETVAL=$? echo return $RETVAL } restart() { stop start } case "$1" in start) start ;; stop) stop ;; restart) restart ;; *) echo $"Usage:$prog {start|stop|restart}" exit esac exit $? |