#!/bin/sh
#
# Copyright 2005 VMware, Inc.  All rights reserved.
#

# Basic support for IRIX style chkconfig 
# chkconfig: 2345 09 91
# description: Initializes firewall

# load system helper functions.
. /etc/init.d/functions

PATH=/sbin:/usr/sbin:/bin:/usr/bin
export PATH

# See how we were called.
case "$1" in
   start)
        action "Starting firewall" /usr/sbin/esxcfg-firewall -l
        ;;

   stop)
        action "Stopping firewall" /usr/sbin/esxcfg-firewall -u
        ;;

   status)
        /usr/sbin/esxcfg-firewall -q
	;;

   restart)
	"$0" stop && "$0" start
	;;
   *)
	echo "Usage: `basename "$0"` {start|stop|status|restart}"
	exit 1
esac

exit 0
