#!/bin/sh

case "$1" in
start)
	ulimit -s 512
	exec start-stop-daemon -S -x /usr/bin/oscam_oscamsmartcard -- -b -r 2 -c /etc/tuxbox/config
	;;
stop)
	exec start-stop-daemon -K -R 2 -x /usr/bin/oscam_oscamsmartcard &
	sleep 2
	killall -9 oscam 2>/dev/null
	sleep 2
	rm -rf /tmp/.oscam
	;;
restart|reload)
	$0 stop
	sleep 1
	$0 start
	;;
version)
	echo "OscamSmartcard"
	;;
info)
	echo "OscamSmartcard"
	;;
*)
	echo "Usage: $0 start|stop|restart"
	exit 1
	;;
esac
exit 0

