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
26 [ $ret -eq 0 ] && success || failure
29 echo "super dbcleanup" | ${IPFW_BACKEND} root >& /dev/null
30 echo "super init" | ${IPFW_BACKEND} root >& /dev/null
36 # clean netconfig stuff
37 echo "super dbcleanup" | ${IPFW_BACKEND} root >& /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 grep '^ipfw_mod$' /proc/modules >& /dev/null || echo "ipfw not loaded" && return 0
54 USERS=$(grep BLOCK /tmp/ff | wc -l)
55 echo "ipfw is loaded and there are currently ${USERS} with active emulation."
79 echo $"Usage: $0 {start|stop|restart|status}"