#! /bin/sh
#
# start p0f
### BEGIN INIT INFO
# Provides:       p0f
# Required-Start: $remote_fs
# Required-Stop:  $remote_fs
# Should-Start:   $network $syslog
# Default-Start:  2 3 4 5
# Default-Stop:   0 1 6
### END INIT INFO


case "$1" in
        start)
        /usr/sbin/p0f -l 'tcp dst port 25' 2>&1 | /usr/sbin/p0f-analyzer.pl 2345 &
         ;;

        stop)  ps aux | grep p0 | grep -v grep | grep -v stop
	echo "You will have to kill p0f and p0f-analyzer.pl manually"
         ;;

        *) N=/etc/init.d/$NAME
        echo "Usage: $N {start|stop}" >&2
        exit 1
         ;;
esac
exit 0

