3 # ipfw init the emulation service
5 # chkconfig: 2345 09 91
6 # description: ipfw init and shutdown
9 # Source function library.
10 . /etc/init.d/functions
13 IPFW_BACKEND=/vsys/ipfw-be
16 if [ ! -x /sbin/$IPFW ] || [ ! -x ${IPFW_BACKEND} ]; then
17 echo -n "/sbin/$IPFW does not exist."; warning; echo
21 # Load the ipfw module, and initialize netconfig
24 modprobe $IPFW_MOD > /dev/null 2> /dev/null
26 [ $ret -eq 0 ] && success || failure
29 echo "super dbcleanup" | ${IPFW_BACKEND} root > /dev/null 2> /dev/null
30 echo "super init" | ${IPFW_BACKEND} root > /dev/null 2> /dev/null
36 # clean netconfig stuff
37 echo "super dbcleanup" | ${IPFW_BACKEND} root > /dev/null 2> /dev/null
38 echo "Unloading $IPFW_MOD module: "
40 # unload the ipfw module
43 [ $ret -eq 0 ] && success || failure
48 # echo the ipfw status
50 # check for module presence
51 LOADED=`cat /proc/modules | grep ^ipfw_mod`
52 [ ! -n "$LOADED" ] && echo "ipfw not loaded" && return 0
55 USERS=`cat /tmp/ff | grep BLOCK | wc -l`
56 echo "ipfw is loaded and there are currently ${USERS} with active emulation."
80 echo $"Usage: $0 {start|stop|restart|status}"