Browse Source

- add new target 'make init-scripts' to avoid duplicates in skel-root

master
vanhofen 7 years ago
parent
commit
dd7afd9e77
  1. 63
      archive-imagefiles/scripts/camd.init
  2. 23
      archive-imagefiles/scripts/camd_datefix.init
  3. 1
      make/ni.mk
  4. 14
      make/plugins.mk
  5. 4
      make/rootfs.mk
  6. 75
      skel-root/armbox/hd51/etc/init.d/oscamfix
  7. 307
      skel-root/coolstream/hd1/etc/init.d/emu
  8. 75
      skel-root/coolstream/hd1/etc/init.d/oscamfix
  9. 307
      skel-root/coolstream/hd2/etc/init.d/emu

63
skel-root/armbox/hd51/etc/init.d/emu → archive-imagefiles/scripts/camd.init

@ -2,7 +2,7 @@
. /etc/init.d/globals
# Emu-Fileflags
# Camd-Fileflags
FLAGDIR="/var/etc"
F_MGCAM=".mgcamd"
F_NEWCS=".newcs"
@ -12,6 +12,7 @@ F_OSCAM=".oscam"
F_NCAM=".ncam"
F_GBOX=".gbox"
F_CS2GBOX=".cs2gbox"
F_CIPLUSHELPER=".ciplushelper"
MGCAM_Action()
{
@ -97,8 +98,8 @@ DOSCAM_Action()
ulimit -c unlimited
fi
SHOWINFO "start oscamfix"
/etc/init.d/oscamfix start doscam
SHOWINFO "start camd_datefix"
/etc/init.d/camd_datefix start doscam
SHOWINFO "start doscam"
/var/bin/doscam -b -w0
if [ -e $FLAGDIR/$F_MGCAM ]; then
@ -106,8 +107,8 @@ DOSCAM_Action()
fi
;;
"stop" )
SHOWINFO "stop oscamfix"
/etc/init.d/oscamfix stop doscam
SHOWINFO "stop camd_datefix"
/etc/init.d/camd_datefix stop doscam
SHOWINFO "stop doscam"
killall doscam
sleep 1
@ -126,8 +127,8 @@ OSCAM_Action()
{
case $1 in
"start" )
SHOWINFO "start oscamfix"
/etc/init.d/oscamfix start oscam
SHOWINFO "start camd_datefix"
/etc/init.d/camd_datefix start oscam
SHOWINFO "start oscam"
/var/bin/oscam -b
if [ -e $FLAGDIR/$F_MGCAM ]; then
@ -135,8 +136,8 @@ OSCAM_Action()
fi
;;
"stop" )
SHOWINFO "stop oscamfix"
/etc/init.d/oscamfix stop oscam
SHOWINFO "stop camd_datefix"
/etc/init.d/camd_datefix stop oscam
SHOWINFO "stop oscam"
killall oscam
sleep 1
@ -155,8 +156,8 @@ NCAM_Action()
{
case $1 in
"start" )
SHOWINFO "start oscamfix"
/etc/init.d/oscamfix start ncam
SHOWINFO "start camd_datefix"
/etc/init.d/camd_datefix start ncam
SHOWINFO "start ncam"
/var/bin/ncam -b
if [ -e $FLAGDIR/$F_MGCAM ]; then
@ -164,8 +165,8 @@ NCAM_Action()
fi
;;
"stop" )
SHOWINFO "stop oscamfix"
/etc/init.d/oscamfix stop ncam
SHOWINFO "stop camd_datefix"
/etc/init.d/camd_datefix stop ncam
SHOWINFO "stop ncam"
killall ncam
sleep 1
@ -228,9 +229,33 @@ CS2GBOX_Action()
esac
}
EMU_Action()
CIPLUSHELPER_Action()
{
case $1 in
"start" )
SHOWINFO "start ciplushelper"
/var/bin/ciplushelper &
sleep 1
;;
"stop" )
SHOWINFO "stop ciplushelper"
killall ciplushelper
sleep 1
;;
* )
CIPLUSHELPER_Action "stop"
sleep 1
CIPLUSHELPER_Action "start"
;;
esac
}
CAMD_Action()
{
case $1 in
"ciplushelper")
CIPLUSHELPER_Action $ACTION
;;
"cs2gbox")
CS2GBOX_Action $ACTION
;;
@ -256,6 +281,10 @@ EMU_Action()
MGCAM_Action $ACTION
;;
*)
if [ -e $FLAGDIR/$F_CIPLUSHELPER ]; then
CIPLUSHELPER_Action $ACTION
fi
if [ -e $FLAGDIR/$F_CS2GBOX ]; then
CS2GBOX_Action $ACTION
fi
@ -294,14 +323,14 @@ EMU_Action()
case $1 in
"start")
ACTION="start"
EMU_Action $2
CAMD_Action $2
;;
"stop")
ACTION="stop"
EMU_Action $2
CAMD_Action $2
;;
*)
ACTION="restart"
EMU_Action $2
CAMD_Action $2
;;
esac

23
skel-root/coolstream/hd2/etc/init.d/oscamfix → archive-imagefiles/scripts/camd_datefix.init

@ -1,6 +1,6 @@
#!/bin/sh
#
# a workaround for the sucking date behavior of oscam
# a workaround for the sucking date behavior of doscam, oscam and ncam
#
. /etc/init.d/globals
@ -11,17 +11,18 @@ FLAGFILE="/var/etc/.$2"
case "$1" in
"start")
DATE_TODAY=$(date +%Y%m%d%H%M)
if [ "${DATE_TODAY:0:8}" = "19700101" ]; then
# keep line below in sync with dummy time in rcS
if [ "${DATE_TODAY:0:8}" = "20170101" ]; then
# try to read date from flagfile
test -e $FLAGFILE && \
DATE_FLAG=$(date -r $FLAGFILE +%Y%m%d%H%M)
# try to read date from binary
DATE_OSCAM=$(strings $BINARY | grep -B1 "is smaller than the build date")
DATE_OSCAM=${DATE_OSCAM:0:11}
_m=$(echo $DATE_OSCAM | cut -d\ -f1)
_d=$(echo $DATE_OSCAM | cut -d\ -f2)
_y=$(echo $DATE_OSCAM | cut -d\ -f3)
DATE_CAMD=$(strings $BINARY | grep -B1 "is smaller than the build date")
DATE_CAMD=${DATE_CAMD:0:11}
_m=$(echo $DATE_CAMD | cut -d\ -f1)
_d=$(echo $DATE_CAMD | cut -d\ -f2)
_y=$(echo $DATE_CAMD | cut -d\ -f3)
c=0
for m in Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec; do
@ -35,25 +36,25 @@ case "$1" in
test ${#_m} -lt 2 && _m=0$_m
test ${#_d} -lt 2 && _d=0$_d
DATE_OSCAM=$_y$_m$_d
DATE_CAMD=$_y$_m$_d
# try to read date from versionfile
DATE_IMAGE=$(cat /.version | grep "^version=" | cut -d= -f2)
DATE_IMAGE=${DATE_IMAGE:4}
c=0
for date in "$DATE_FLAG" "$DATE_OSCAM" "$DATE_IMAGE"; do
for date in "$DATE_FLAG" "$DATE_CAMD" "$DATE_IMAGE"; do
c=$(($c+1))
while [ ${#date} -lt 12 ]; do
date=$date"0"
done
test $c = 1 && DATE_FLAG=$date
test $c = 2 && DATE_OSCAM=$date
test $c = 2 && DATE_CAMD=$date
test $c = 3 && DATE_IMAGE=$date
done
SHOWINFO "manipulating date ... "
for date in "$DATE_FLAG" "$DATE_OSCAM" "$DATE_IMAGE"; do
for date in "$DATE_FLAG" "$DATE_CAMD" "$DATE_IMAGE"; do
echo $date;
done | sort -r -u | while read date; do
if date -s $date > /dev/null; then

1
make/ni.mk

@ -105,6 +105,7 @@ endif
ifeq ($(PERSONALIZE), yes)
make personalize
endif
make init-scripts
make rootfs
make images
@make done

14
make/plugins.mk

@ -36,6 +36,9 @@ $(VARPLUG) \
$(VARCONF) : | $(TARGETPREFIX)
mkdir -p $@
init-scripts: \
init-camd
plugins-all: $(D)/neutrino \
getrc \
input \
@ -79,6 +82,17 @@ plugins-hd2: # nothing to do
plugins-hd51: \
showiframe
#####################
### init-scripts ###
#####################
init-camd: $(ETCINIT)
install -m755 $(IMAGEFILES)/scripts/camd.init $(ETCINIT)/camd && \
install -m755 $(IMAGEFILES)/scripts/camd_datefix.init $(ETCINIT)/camd_datefix
cd $(ETCINIT) && \
ln -sf camd S99camd && \
ln -sf camd K01camd
################
### plugins ###
################

4
make/rootfs.mk

@ -117,9 +117,7 @@ softlinks: $(BOX)
ln -sf crond S55crond && \
ln -sf crond K55crond && \
ln -sf inetd S53inetd && \
ln -sf inetd K80inetd && \
ln -sf emu S99emu && \
ln -sf emu K01emu
ln -sf inetd K80inetd
pushd $(BOX)/lib && \
ln -sf libcrypto.so.1.0.0 libcrypto.so.1.0.2 && \
ln -sf libssl.so.1.0.0 libssl.so.1.0.2 && \

75
skel-root/armbox/hd51/etc/init.d/oscamfix

@ -1,75 +0,0 @@
#!/bin/sh
#
# a workaround for the sucking date behavior of oscam
#
. /etc/init.d/globals
BINARY="/var/bin/$2"
FLAGFILE="/var/etc/.$2"
case "$1" in
"start")
DATE_TODAY=$(date +%Y%m%d%H%M)
if [ "${DATE_TODAY:0:8}" = "19700101" ]; then
# try to read date from flagfile
test -e $FLAGFILE && \
DATE_FLAG=$(date -r $FLAGFILE +%Y%m%d%H%M)
# try to read date from binary
DATE_OSCAM=$(strings $BINARY | grep -B1 "is smaller than the build date")
DATE_OSCAM=${DATE_OSCAM:0:11}
_m=$(echo $DATE_OSCAM | cut -d\ -f1)
_d=$(echo $DATE_OSCAM | cut -d\ -f2)
_y=$(echo $DATE_OSCAM | cut -d\ -f3)
c=0
for m in Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec; do
c=$(($c+1))
if [ "$m" = "$_m" ]; then
_m=$c
break
fi
done
test ${#_m} -lt 2 && _m=0$_m
test ${#_d} -lt 2 && _d=0$_d
DATE_OSCAM=$_y$_m$_d
# try to read date from versionfile
DATE_IMAGE=$(cat /.version | grep "^version=" | cut -d= -f2)
DATE_IMAGE=${DATE_IMAGE:4}
c=0
for date in "$DATE_FLAG" "$DATE_OSCAM" "$DATE_IMAGE"; do
c=$(($c+1))
while [ ${#date} -lt 12 ]; do
date=$date"0"
done
test $c = 1 && DATE_FLAG=$date
test $c = 2 && DATE_OSCAM=$date
test $c = 3 && DATE_IMAGE=$date
done
SHOWINFO "manipulating date ... "
for date in "$DATE_FLAG" "$DATE_OSCAM" "$DATE_IMAGE"; do
echo $date;
done | sort -r -u | while read date; do
if date -s $date > /dev/null; then
SHOWINFO "done ($date)"
break
else
continue
fi
SHOWWARN "failed"
done
fi
;;
"stop")
test -e $FLAGFILE && touch $FLAGFILE
;;
*)
echo "[$BASENAME] Usage: $0 {start|stop}"
;;
esac

307
skel-root/coolstream/hd1/etc/init.d/emu

@ -1,307 +0,0 @@
#!/bin/sh
. /etc/init.d/globals
# Emu-Fileflags
FLAGDIR="/var/etc"
F_MGCAM=".mgcamd"
F_NEWCS=".newcs"
F_OSEMU=".osemu"
F_DOSCAM=".doscam"
F_OSCAM=".oscam"
F_NCAM=".ncam"
F_GBOX=".gbox"
F_CS2GBOX=".cs2gbox"
MGCAM_Action()
{
case $1 in
"start" )
SHOWINFO "start mgcamd"
{ /var/bin/mgcamd; pzapit -rz; } &
;;
"stop" )
SHOWINFO "stop mgcamd"
kill $( cat /tmp/mgcamd.pid )
sleep 1
rm -rf /tmp/mgstat.info
rm -rf /tmp/mgshare.info
rm -rf /tmp/ecm.info
rm -rf /tmp/pid.info
rm -rf /tmp/ca_cache.list
rm -rf /tmp/cccam.info
rm -rf /tmp/ecm.info
rm -rf /tmp/mg.info
;;
* )
MGCAM_Action "stop"
sleep 1
MGCAM_Action "start"
;;
esac
}
NEWCS_Action()
{
case $1 in
"start" )
SHOWINFO "start newcs"
/var/bin/newcs
sleep 10
;;
"stop" )
SHOWINFO "stop newcs"
kill $( cat /tmp/newcs.pid )
sleep 1
rm -rf /tmp/cccam.info
rm -rf /tmp/ecm.info
rm -rf /tmp/pid.info
;;
* )
NEWCS_Action "stop"
sleep 1
NEWCS_Action "start"
;;
esac
}
OSEMU_Action()
{
case $1 in
"start" )
SHOWINFO "start osemu"
if [ -x /var/bin/osemu.sh ]; then
/var/bin/osemu.sh &
else
/var/bin/osemu -a user:password -p 11000 -b
fi
;;
"stop" )
SHOWINFO "stop osemu"
killall osemu
sleep 1
;;
* )
OSEMU_Action "stop"
sleep 1
OSEMU_Action "start"
;;
esac
}
DOSCAM_Action()
{
case $1 in
"start" )
if [ -e /var/etc/.coredump ]; then
ulimit -c unlimited
fi
SHOWINFO "start oscamfix"
/etc/init.d/oscamfix start doscam
SHOWINFO "start doscam"
/var/bin/doscam -b -w0
if [ -e $FLAGDIR/$F_MGCAM ]; then
sleep 15
fi
;;
"stop" )
SHOWINFO "stop oscamfix"
/etc/init.d/oscamfix stop doscam
SHOWINFO "stop doscam"
killall doscam
sleep 1
rm -rf /tmp/doscam.*
rm -rf /tmp/ecm.info
;;
* )
DOSCAM_Action "stop"
sleep 1
DOSCAM_Action "start"
;;
esac
}
OSCAM_Action()
{
case $1 in
"start" )
SHOWINFO "start oscamfix"
/etc/init.d/oscamfix start oscam
SHOWINFO "start oscam"
/var/bin/oscam -b
if [ -e $FLAGDIR/$F_MGCAM ]; then
sleep 15
fi
;;
"stop" )
SHOWINFO "stop oscamfix"
/etc/init.d/oscamfix stop oscam
SHOWINFO "stop oscam"
killall oscam
sleep 1
rm -rf /tmp/oscam.*
rm -rf /tmp/ecm.info
;;
* )
OSCAM_Action "stop"
sleep 1
OSCAM_Action "start"
;;
esac
}
NCAM_Action()
{
case $1 in
"start" )
SHOWINFO "start oscamfix"
/etc/init.d/oscamfix start ncam
SHOWINFO "start ncam"
/var/bin/ncam -b
if [ -e $FLAGDIR/$F_MGCAM ]; then
sleep 15
fi
;;
"stop" )
SHOWINFO "stop oscamfix"
/etc/init.d/oscamfix stop ncam
SHOWINFO "stop ncam"
killall ncam
sleep 1
rm -rf /tmp/ncam.*
rm -rf /tmp/ecm.info
;;
* )
NCAM_Action "stop"
sleep 1
NCAM_Action "start"
;;
esac
}
GBOX_Action()
{
case $1 in
"start" )
SHOWINFO "start gbox"
/var/bin/gbox &
sleep 10
;;
"stop" )
SHOWINFO "stop gbox"
touch /tmp/gbox.kill
sleep 1
rm -rf /tmp/pid.info
rm -rf /tmp/ecm.info
rm -rf /tmp/gbox.pid
rm -rf /tmp/gbox.ver
rm -rf /tmp/gbox.kill
;;
* )
GBOX_Action "stop"
sleep 1
GBOX_Action "start"
;;
esac
}
CS2GBOX_Action()
{
case $1 in
"start" )
SHOWINFO "start cs2gbox"
/var/bin/cs2gbox &
sleep 3
;;
"stop" )
SHOWINFO "stop cs2gbox"
killall -9 cs2gbox
sleep 1
rm -rf /tmp/csonline.txt
;;
* )
CS2GBOX_Action "stop"
sleep 1
CS2GBOX_Action "start"
;;
esac
}
EMU_Action()
{
case $1 in
"cs2gbox")
CS2GBOX_Action $ACTION
;;
"gbox")
GBOX_Action $ACTION
;;
"osemu")
OSEMU_Action $ACTION
;;
"doscam")
DOSCAM_Action $ACTION
;;
"oscam")
OSCAM_Action $ACTION
;;
"ncam")
NCAM_Action $ACTION
;;
"newcs")
NEWCS_Action $ACTION
;;
"mgcamd")
MGCAM_Action $ACTION
;;
*)
if [ -e $FLAGDIR/$F_CS2GBOX ]; then
CS2GBOX_Action $ACTION
fi
if [ -e $FLAGDIR/$F_GBOX ]; then
GBOX_Action $ACTION
fi
if [ -e $FLAGDIR/$F_OSEMU ]; then
OSEMU_Action $ACTION
fi
if [ -e $FLAGDIR/$F_DOSCAM ]; then
DOSCAM_Action $ACTION
fi
if [ -e $FLAGDIR/$F_OSCAM ]; then
OSCAM_Action $ACTION
fi
if [ -e $FLAGDIR/$F_NCAM ]; then
NCAM_Action $ACTION
fi
if [ -e $FLAGDIR/$F_NEWCS ]; then
NEWCS_Action $ACTION
fi
if [ -e $FLAGDIR/$F_MGCAM ]; then
MGCAM_Action $ACTION
fi
;;
esac
}
case $1 in
"start")
ACTION="start"
EMU_Action $2
;;
"stop")
ACTION="stop"
EMU_Action $2
;;
*)
ACTION="restart"
EMU_Action $2
;;
esac

75
skel-root/coolstream/hd1/etc/init.d/oscamfix

@ -1,75 +0,0 @@
#!/bin/sh
#
# a workaround for the sucking date behavior of oscam
#
. /etc/init.d/globals
BINARY="/var/bin/$2"
FLAGFILE="/var/etc/.$2"
case "$1" in
"start")
DATE_TODAY=$(date +%Y%m%d%H%M)
if [ "${DATE_TODAY:0:8}" = "19700101" ]; then
# try to read date from flagfile
test -e $FLAGFILE && \
DATE_FLAG=$(date -r $FLAGFILE +%Y%m%d%H%M)
# try to read date from binary
DATE_OSCAM=$(strings $BINARY | grep -B1 "is smaller than the build date")
DATE_OSCAM=${DATE_OSCAM:0:11}
_m=$(echo $DATE_OSCAM | cut -d\ -f1)
_d=$(echo $DATE_OSCAM | cut -d\ -f2)
_y=$(echo $DATE_OSCAM | cut -d\ -f3)
c=0
for m in Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec; do
c=$(($c+1))
if [ "$m" = "$_m" ]; then
_m=$c
break
fi
done
test ${#_m} -lt 2 && _m=0$_m
test ${#_d} -lt 2 && _d=0$_d
DATE_OSCAM=$_y$_m$_d
# try to read date from versionfile
DATE_IMAGE=$(cat /.version | grep "^version=" | cut -d= -f2)
DATE_IMAGE=${DATE_IMAGE:4}
c=0
for date in "$DATE_FLAG" "$DATE_OSCAM" "$DATE_IMAGE"; do
c=$(($c+1))
while [ ${#date} -lt 12 ]; do
date=$date"0"
done
test $c = 1 && DATE_FLAG=$date
test $c = 2 && DATE_OSCAM=$date
test $c = 3 && DATE_IMAGE=$date
done
SHOWINFO "manipulating date ... "
for date in "$DATE_FLAG" "$DATE_OSCAM" "$DATE_IMAGE"; do
echo $date;
done | sort -r -u | while read date; do
if date -s $date > /dev/null; then
SHOWINFO "done ($date)"
break
else
continue
fi
SHOWWARN "failed"
done
fi
;;
"stop")
test -e $FLAGFILE && touch $FLAGFILE
;;
*)
echo "[$BASENAME] Usage: $0 {start|stop}"
;;
esac

307
skel-root/coolstream/hd2/etc/init.d/emu

@ -1,307 +0,0 @@
#!/bin/sh
. /etc/init.d/globals
# Emu-Fileflags
FLAGDIR="/var/etc"
F_MGCAM=".mgcamd"
F_NEWCS=".newcs"
F_OSEMU=".osemu"
F_DOSCAM=".doscam"
F_OSCAM=".oscam"
F_NCAM=".ncam"
F_GBOX=".gbox"
F_CS2GBOX=".cs2gbox"
MGCAM_Action()
{
case $1 in
"start" )
SHOWINFO "start mgcamd"
{ /var/bin/mgcamd; pzapit -rz; } &
;;
"stop" )
SHOWINFO "stop mgcamd"
kill $( cat /tmp/mgcamd.pid )
sleep 1
rm -rf /tmp/mgstat.info
rm -rf /tmp/mgshare.info
rm -rf /tmp/ecm.info
rm -rf /tmp/pid.info
rm -rf /tmp/ca_cache.list
rm -rf /tmp/cccam.info
rm -rf /tmp/ecm.info
rm -rf /tmp/mg.info
;;
* )
MGCAM_Action "stop"
sleep 1
MGCAM_Action "start"
;;
esac
}
NEWCS_Action()
{
case $1 in
"start" )
SHOWINFO "start newcs"
/var/bin/newcs
sleep 10
;;
"stop" )
SHOWINFO "stop newcs"
kill $( cat /tmp/newcs.pid )
sleep 1
rm -rf /tmp/cccam.info
rm -rf /tmp/ecm.info
rm -rf /tmp/pid.info
;;
* )
NEWCS_Action "stop"
sleep 1
NEWCS_Action "start"
;;
esac
}
OSEMU_Action()
{
case $1 in
"start" )
SHOWINFO "start osemu"
if [ -x /var/bin/osemu.sh ]; then
/var/bin/osemu.sh &
else
/var/bin/osemu -a user:password -p 11000 -b
fi
;;
"stop" )
SHOWINFO "stop osemu"
killall osemu
sleep 1
;;
* )
OSEMU_Action "stop"
sleep 1
OSEMU_Action "start"
;;
esac
}
DOSCAM_Action()
{
case $1 in
"start" )
if [ -e /var/etc/.coredump ]; then
ulimit -c unlimited
fi
SHOWINFO "start oscamfix"
/etc/init.d/oscamfix start doscam
SHOWINFO "start doscam"
/var/bin/doscam -b -w0
if [ -e $FLAGDIR/$F_MGCAM ]; then
sleep 15
fi
;;
"stop" )
SHOWINFO "stop oscamfix"
/etc/init.d/oscamfix stop doscam
SHOWINFO "stop doscam"
killall doscam
sleep 1
rm -rf /tmp/doscam.*
rm -rf /tmp/ecm.info
;;
* )
DOSCAM_Action "stop"
sleep 1
DOSCAM_Action "start"
;;
esac
}
OSCAM_Action()
{
case $1 in
"start" )
SHOWINFO "start oscamfix"
/etc/init.d/oscamfix start oscam
SHOWINFO "start oscam"
/var/bin/oscam -b
if [ -e $FLAGDIR/$F_MGCAM ]; then
sleep 15
fi
;;
"stop" )
SHOWINFO "stop oscamfix"
/etc/init.d/oscamfix stop oscam
SHOWINFO "stop oscam"
killall oscam
sleep 1
rm -rf /tmp/oscam.*
rm -rf /tmp/ecm.info
;;
* )
OSCAM_Action "stop"
sleep 1
OSCAM_Action "start"
;;
esac
}
NCAM_Action()
{
case $1 in
"start" )
SHOWINFO "start oscamfix"
/etc/init.d/oscamfix start ncam
SHOWINFO "start ncam"
/var/bin/ncam -b
if [ -e $FLAGDIR/$F_MGCAM ]; then
sleep 15
fi
;;
"stop" )
SHOWINFO "stop oscamfix"
/etc/init.d/oscamfix stop ncam
SHOWINFO "stop ncam"
killall ncam
sleep 1
rm -rf /tmp/ncam.*
rm -rf /tmp/ecm.info
;;
* )
NCAM_Action "stop"
sleep 1
NCAM_Action "start"
;;
esac
}
GBOX_Action()
{
case $1 in
"start" )
SHOWINFO "start gbox"
/var/bin/gbox &
sleep 10
;;
"stop" )
SHOWINFO "stop gbox"
touch /tmp/gbox.kill
sleep 1
rm -rf /tmp/pid.info
rm -rf /tmp/ecm.info
rm -rf /tmp/gbox.pid
rm -rf /tmp/gbox.ver
rm -rf /tmp/gbox.kill
;;
* )
GBOX_Action "stop"
sleep 1
GBOX_Action "start"
;;
esac
}
CS2GBOX_Action()
{
case $1 in
"start" )
SHOWINFO "start cs2gbox"
/var/bin/cs2gbox &
sleep 3
;;
"stop" )
SHOWINFO "stop cs2gbox"
killall -9 cs2gbox
sleep 1
rm -rf /tmp/csonline.txt
;;
* )
CS2GBOX_Action "stop"
sleep 1
CS2GBOX_Action "start"
;;
esac
}
EMU_Action()
{
case $1 in
"cs2gbox")
CS2GBOX_Action $ACTION
;;
"gbox")
GBOX_Action $ACTION
;;
"osemu")
OSEMU_Action $ACTION
;;
"doscam")
DOSCAM_Action $ACTION
;;
"oscam")
OSCAM_Action $ACTION
;;
"ncam")
NCAM_Action $ACTION
;;
"newcs")
NEWCS_Action $ACTION
;;
"mgcamd")
MGCAM_Action $ACTION
;;
*)
if [ -e $FLAGDIR/$F_CS2GBOX ]; then
CS2GBOX_Action $ACTION
fi
if [ -e $FLAGDIR/$F_GBOX ]; then
GBOX_Action $ACTION
fi
if [ -e $FLAGDIR/$F_OSEMU ]; then
OSEMU_Action $ACTION
fi
if [ -e $FLAGDIR/$F_DOSCAM ]; then
DOSCAM_Action $ACTION
fi
if [ -e $FLAGDIR/$F_OSCAM ]; then
OSCAM_Action $ACTION
fi
if [ -e $FLAGDIR/$F_NCAM ]; then
NCAM_Action $ACTION
fi
if [ -e $FLAGDIR/$F_NEWCS ]; then
NEWCS_Action $ACTION
fi
if [ -e $FLAGDIR/$F_MGCAM ]; then
MGCAM_Action $ACTION
fi
;;
esac
}
case $1 in
"start")
ACTION="start"
EMU_Action $2
;;
"stop")
ACTION="stop"
EMU_Action $2
;;
*)
ACTION="restart"
EMU_Action $2
;;
esac
Loading…
Cancel
Save