#! /bin/sh

NAME=axisstc
DAEMON=/usr/bin/$NAME
DESC="Remote Service Client"

. /etc/init.d/functions.sh
. /lib/rcscripts/sh/rc-std2parse.sh
. /etc/conf.d/remoteservice

start_axisstc() {
	std2parse /etc/$NAME.conf
	if [ "$STD2_MJPEG_ENABLED" != no ]; then
		start_daemon $DAEMON $AXISSTC_OPTIONS
	else
		information "$DESC disabled"
	fi
}

stop_axisstc() {
	stop_daemon $DAEMON $AXISSTC_OPTIONS
}

case "$1" in
	start)
		begin "Starting $DESC"
		start_axisstc
		end $?
		;;
	stop)
		begin "Stopping $DESC"
		stop_axisstc
		end $?
		;;
	restart)
		begin "Restarting $DESC"
		stop_axisstc && start_axisstc
		end $?
		;;
	*)
		error "Usage: $0 start|stop|restart"
		;;
esac
