#!/bin/sh########################################
###### Powered by NewNigma2 Team ######
### http://newngima2.to ###
########################################
EMUNAME="OScam unstable #8779"
OSVer="oscam-unstable"
remove_tmp ()
{
[ -e /tmp/ecm.info ] && rm -rf /tmp/ecm.info
[ -e /tmp/ecm0.info ] && rm -rf /tmp/ecm0.info
[ -e /tmp/ecm1.info ] && rm -rf /tmp/ecm0.info
[ -e /tmp/.oscam ] && rm -rf /tmp/.oscam
[ -e /tmp/oscam.log ] && rm -rf /tmp/oscam.log
[ -e /tmp/oscamuser.log ] && rm -rf /tmp/oscamuser.log
}
case "$1" in
start)
echo "[SCRIPT] $1: $EMUNAME"
if [ `pidof $OSVer | wc -l` == 1 ]; then
echo "[0;31m $OSVer already running...[0m"
elif [ -f /usr/keys/oscam.conf ]; then
/usr/bin/$OSVer -c /usr/keys > /dev/null 2>&1 &
else /usr/bin/$OSVer -c /etc/tuxbox/config > /dev/null 2>&1 &
fi
;;
stop)
echo "[SCRIPT] $1: $EMUNAME"
if [ `pidof $OSVer | wc -l` == 0 ]; then
echo "[0;31m $OSVer not running...[0m"
else
kill `pidof $OSVer`
sleep 2
fi
if [ `pidof $OSVer | wc -l` == 1 ]; then
kill -9 `pidof $OSVer`
fi
remove_tmp
;;
restart)
$0 stop
sleep 2
$0 start
;;
*)
echo "[0;32m Usage: $0 start|stop|restart[0m"
exit 1
;;
esac
exit 0