#!/bin/sh
#
# Startup script for port forwarding
#
# $id:$
#
# description: executes the rules located in /etc/portfw.conf
# config: /etc/portfw.conf (generated by CCE)

. /etc/rc.d/init.d/functions

# a function to reset a chain
PORTFWCONF="/etc/portfw.conf"

case "$1" in
	start | reload | restart)
		echo -n "Loading portfw rules: "
		if test -e $PORTFWCONF
		then
			$PORTFWCONF
			success "portfw startup"
		else
			echo "no rules found"
		fi
		;;
	stop)
                echo -n "Unloading portfw rules: "
		/usr/sbin/ipmasqadm portfw -f
                success "portfw shutdown"
		;;
	*)
		echo "Usage: $0 {start|reload|restart|stop}"
		exit 1
esac

echo ""

exit 0


