#!/bin/sh
###############################
###### Powered by PPTEAM ######
#### http://www.digsat.net ####
###############################
NAME="MgCamd_1.35a"


remove_tmp () {
	rm -rf /tmp/camd.socket /tmp/*mgcamd* /tmp/*mgshare* /tmp/pid.info /tmp/ecm.info /tmp/cardinfo
}

case "$1" in
	start)
	echo "[SCRIPT] $1: $CAMNAME"
	remove_tmp
	sleep 1
	/var/bin/mgcamd_1.35a.mips &
	;;
	stop)
	echo "[SCRIPT] $1: $CAMNAME"
	kill 2>/dev/null `cat 2>/dev/null /tmp/mgcamd.pid`
 	killall -9 mgcamd_1.35a.mips 2>/dev/null
	remove_tmp
	;;
	*)
	$0 stop
	exit 1
	;;
esac

exit 0
