#!/bin/sh
#
# Startup script for FilterProxy

# Source function library.
DAEMON=/usr/sbin/FilterProxy
NAME=FilterProxy

# Insert your own options here, like "-f /etc/myconfig" to use /etc/myconf instead of
# /etc/filterproxy.conf
OPTIONS="-f /etc/filterproxy.conf"
PORT=8888

[ -x $DAEMON ] || exit 0;

# See how we were called.
case "$1" in
	start)
		echo -n "Starting FilterProxy: "
		start-stop-daemon --start --name $NAME --chuid filterproxy:filterproxy --exec $DAEMON -- -p $PORT $OPTIONS
		echo "done"
		;;
	stop)
		echo -n "Shutting down FilterProxy: "
		start-stop-daemon --stop --oknodo --retry KILL/5 --name $NAME
		echo "done"
		;;
	restart|force-reload)
		$0 stop
		$0 start
		;;
	*)
		echo "Usage: $0 {start|stop|restart}"
		exit 1
esac

exit 0
