#! /bin/bash
# Copyright (C) 2009 invis-server.org
#
# Author: Stefan Schäfer
# Fragen: http://forum.invis-server.org
# License: GPLv3
#
# /etc/init.d/rootwall_init
#
### BEGIN INIT INFO
# Provides: rootwall
# Required-Start: $network $remote_fs
# Should-Start:   $ALL
# Required-Stop:  $remote_fs
# Should-Stop:    $null
# Default-Start:  3 4 5
# Default-Stop:   0 1 2 6
# Short-Description: Rootserver Firewall-Script
# Description: Firewall for Rootserver
### END INIT INFO

ROOTWALL="/sbin/rootwall"

test -x $ROOTWALL || exit 5

. /etc/rc.status
rc_reset

case "$1" in
    start)
	echo -n "Starting the Firewall"
	$ROOTWALL --start
	rc_status -v
	;;
    stop)
	echo -n "Shutting down the Firewall "
	$ROOTWALL --stop
	rc_status -v
	;;
    restart)
	$ROOTWALL --start
	rc_status -v
	;;
    justssh)
	$ROOTWALL --justssh
	rc_status -v
	;;
    status)
	echo -n "Checking the status of rootwall "
	$ROOTWALL --status
	rc_status -v
	;;
    *)
	echo "Usage: $0 {start|stop|status|restart|justssh}"
	exit 1
	;;
esac

# Set exit status
rc_exit
