#!/bin/sh
########################################
###### Powered by NewNigma2 Team ######
###
Sie müssen registriert sein, um Links zu sehen.
###
########################################
EMUNAME="CCcam 2.3.0 - OScam unstable #8779"
CCVer="CCcam2.3.0"
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/ecm1.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
[ -e /tmp/.CCcam.nodeid ] && rm -rf /tmp/.CCcam.nodeid
[ -e /tmp/warnings.txt ] && rm -rf /tmp/warnings.txt
}
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 &
sleep 5
else /usr/bin/$OSVer -c /etc/tuxbox/config > /dev/null 2>&1 &
sleep 5
fi
if [ `pidof $CCVer | wc -l` == 1 ]; then
echo "[0;31m $CCVer already running...[0m"
else
/usr/bin/$CCVer
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
if [ `pidof $CCVer | wc -l` == 0 ]; then
echo "[0;31m $CCVer not running...[0m"
else
kill `pidof $CCVer`
sleep 2
fi
if [ `pidof $CCVer | wc -l` == 1 ]; then
kill -9 `pidof $CCVer`
fi
remove_tmp
;;
restart)
$0 stop
sleep 2
$0 start
;;
*)
echo "[0;32m Usage: $0 start|stop|restart[0m"
exit 1
;;
esac
exit 0