#! /bin/sh
#

case "$1" in
start)
    need network

    ifconfig eth0 promisc || exit 1
    ifconfig eth1 promisc up || exit 1

    if [ -x /sbin/gatekeeper ] ;then
	/sbin/ipfw flush
	/sbin/ipfw deny ping from all
	/sbin/ipfw deny traceroute from all
	/sbin/gatekeeper eth0 eth1 &
	echo "gatekeeper: started"
    fi
    ;;
stop)
    if killall -0 gatekeeper 2>/dev/null >/dev/null; then
	killall gatekeeper
	echo "gatekeeper: stopped"
    fi
    ;;
info)
    echo "the Gatekeeper firewall"
    ;;
*)
    echo "usage: $0 {stop|start}" 1>&2
    exit 1
esac
exit 0
