#!/bin/sh
#
# Startup script for fwknop
#
# chkconfig: 345 99 05
# description: The Port Scan Attack Detector (fwknop)
# processname: fwknop
# pidfile: /var/run/fwknop.pid
# config: /etc/fwknop/fwknop.conf
#
# $Id: fwknop-init.generic,v 1.2 2004/07/08 12:02:58 mbr Exp $

restart() {
    $0 stop
    $0 start
}

# See how we were called.
case "$1" in
start)
    if grep -q fwknopfifo /etc/syslog.conf; then
        echo -n "Starting the fwknop daemons. "
        /usr/bin/fwknop -d
        echo
    else
        echo "Syslog has not been configured to send kern.info messages to"
        echo "/var/lib/fwknop/fwknopfifo.  Do you need to run the fwknop installer?"
    fi
    ;;
stop)
    /usr/bin/fwknop --Kill
    ;;
status)
    /usr/bin/fwknop --Status
    ;;
restart)
    restart
    ;;
*)
    echo "Usage: fwknop {start|stop|status|restart}"
    exit 1
esac
