#! /bin/sh
### BEGIN INIT INFO
# Provides:          firehol
# Required-Start:    $network $syslog
# Required-Stop:     
# Default-Start:     2 3 5 
# Default-Stop:      0 6 
# Description: Starts firehol firewall configuration 
# short-description: firehol firewall configuration
# required-stop: $network 
### END INIT INFO

#includes lsb functions 
. /lib/lsb/init-functions

PATH=/sbin:/bin
NAME=firehol
DESC=Firewall

test -x /sbin/firehol || exit 0

set -e

COMMAND="$1" 
shift

case "$COMMAND" in
  start)
	log_daemon_msg "Starting $DESC" "$NAME"
	/sbin/firehol start "$@" >/dev/null || log_end_msg 1
	log_end_msg 0
	;;
  stop)
	log_daemon_msg "Stopping $DESC" "$NAME"
	/sbin/firehol stop "$@" >/dev/null || log_end_msg 1
	log_end_msg 0
	;;
  helpme) 
  	log_daemon_msg  "Starting $NAME wizard"
	/usr/sbin/firehol-wizard
	;;
  restart|force-reload)
	log_daemon_msg "Restarting $DESC configuration" 
	/sbin/firehol restart "$@" >/dev/null || log_end_msg 1
	log_action_end_msg 0 
	;;
  *)
	N=/etc/init.d/$NAME
	log_action_msg "Usage: $N {start|stop|restart|force-reload} [<args>]" >&2
	exit 1
	;;
esac

exit 0
