#!/bin/sh
#
# start/stop portfwd.

daemon=/usr/sbin/portfwd
config=/etc/portfwd.cfg
debug=-d

[ -x $daemon ] || exit
[ -e $config ] || exit

case "$1" in
    start)
	echo -n "Starting port forwarding daemon: "
        $daemon "$debug" -c $config
	echo "portfwd."
        ;;
    stop)
	echo -n "Stopping port forwarding daemon: "
        killall portfwd
	echo "portfwd."
        ;;
    *)
        echo "Usage: $0 {start|stop}"
        exit 1
        ;;
esac

exit 0

