Oozoon firmware images hebben een eigen structuur voor de cam daemons.
De binaries leven in /usr/camd
en het startscript vinden we in /usr/script.
Cellie kon geen geschikt startscript voor mbox of newcs vinden en heeft er zelf wat gemaakt. Als uitgangspunt heeft /usr/script/dccamd.sh
gedient, dat via het plugins menu is te downloaden.
De scripts worden opgestart door op de blauwe knop te drukken en dan ‘user scripts’ te kiezen.
Met CAMBIN=bestandsnaam
geef je de bestandsnaam van de camd aan.
Bijvoorbeeld: CAMBIN=
mbox.mips
voor /usr/camd/mbox.mips
Lange sources, dus een mooie gelegenheid om syntax highlighting te demonstreren.
/usr/script/mbox.mips
#!/bin/sh
AUTHOR="cellie - based on the oozoon dccamd.sh script"
CAMNAME="mbox"
CAMBIN=mbox.mips
LINE="--------------------------------------"
INFOFILE="ecm.info"
# end
remove_tmp () {
rm -rf /tmp/cam.info
}
case "$1" in
start)
echo $LINE
echo "[SCRIPT] $1: $CAMNAME"
echo $LINE
remove_tmp
echo $CAMNAME > /tmp/cam.info
ln -s /usr/keys /var/keys
/usr/camd/$CAMBIN > /dev/null 2>&1
;;
stop)
echo $LINE
echo "[SCRIPT] $1: $CAMNAME"
echo $LINE
killall -9 $CAMBIN 2>/dev/null
sleep 2
remove_tmp
;;
restart)
echo $LINE
echo "[SCRIPT] $1: $CAMNAME"
echo $LINE
killall -9 $CAMBIN 2>/dev/null
sleep 2
remove_tmp
sleep 15
echo $CAMNAME > /tmp/cam.info
ln -s /usr/keys /var/keys
/usr/camd/$CAMBIN > /dev/null 2>&1
;;
info)
echo $LINE
echo "[SCRIPT] $1: $CAMNAME"
echo $LINE
if [ -f /tmp/cam.info ]; then
RUNNING_CAM=`cat /tmp/cam.info`
else
RUNNING_CAM="no CAM"
fi
echo -n "$RUNNING_CAM is started "
if [ `ps ax | grep $CAMBIN | grep -v grep | grep -v $0 | wc -l` -gt 0 ]; then
echo "and running"
echo $LINE
ps ax | grep $CAMBIN | grep -v grep | grep -v $0
else
echo "but not running"
fi
echo $LINE
# check newcs also
if [ `ps ax | grep newcs | grep -v grep | grep -v $0 | wc -l` -gt 0 ]; then
echo "and also newcs is running"
echo $LINE
ps ax | grep newcs | grep -v grep | grep -v $0
else
echo "and newcs is not running"
fi
echo $LINE
if [ ! -f /etc/rc3.d/S99camd.sh ]; then
echo "autostart is disabled"
echo $LINE
else
if [ `ls -al /etc/rc3.d/S99camd.sh | grep $CAMBIN.sh | wc -l` -gt 0 ]; then
echo "autostart of $CAMNAME is enabled"
echo $LINE
else
echo "autostart of $CAMNAME is disabled"
echo $LINE
fi
fi
if [ -f /tmp/ecm.info ]; then
echo "ECM info"
echo $LINE
cat /tmp/ecm.info
echo $LINE
fi
if [ -f /tmp/cardinfo ]; then
echo "Card info"
echo $LINE
cat /tmp/cardinfo
echo $LINE
fi
;;
autostart | enable)
echo $LINE
echo "[SCRIPT] $1: $CAMNAME"
echo $LINE
ln -sfn /usr/script/$CAMBIN.sh /etc/rc3.d/S99camd.sh
;;
noautostart | disable)
echo $LINE
echo "[SCRIPT] $1: $CAMNAME"
echo $LINE
rm /etc/rc3.d/S99camd.sh > /dev/null 2>&1
;;
*)
echo "Usage: $0 start|stop|restart|info|enable|disable"
exit 1
;;
esac
exit 0
/usr/script/newcs_1.65
#!/bin/sh
AUTHOR="cellie - based on the oozoon dccamd.sh script"
CAMNAME="newcs"
CAMBIN=newcs_1.65
LINE="--------------------------------------"
INFOFILE="ecm.info"
# end
remove_tmp () {
rm -rf /tmp/cardserver.info
}
case "$1" in
start)
echo $LINE
echo "[SCRIPT] $1: $CAMNAME"
echo $LINE
remove_tmp
echo $CAMNAME > /tmp/cardserver.info
/usr/camd/$CAMBIN > /dev/null 2>&1
;;
stop)
echo $LINE
echo "[SCRIPT] $1: $CAMNAME"
echo $LINE
killall -9 $CAMBIN 2>/dev/null
sleep 2
remove_tmp
;;
restart)
echo $LINE
echo "[SCRIPT] $1: $CAMNAME"
echo $LINE
killall -9 $CAMBIN 2>/dev/null
sleep 2
remove_tmp
sleep 15
echo $CAMNAME > /tmp/cardserver.info
/usr/camd/$CAMBIN > /dev/null 2>&1
;;
info)
echo $LINE
echo "[SCRIPT] $1: $CAMNAME"
echo $LINE
if [ -f /tmp/cam.info ]; then
RUNNING_CAM=`cat /tmp/cardserver.info`
else
RUNNING_CAM="no CAM"
fi
echo -n "$RUNNING_CAM is started "
if [ `ps ax | grep $CAMBIN | grep -v grep | grep -v $0 | wc -l` -gt 0 ]; then
echo "and running"
echo $LINE
ps ax | grep $CAMBIN | grep -v grep | grep -v $0
else
echo "but not running"
fi
echo $LINE
# check newcs also
if [ `ps ax | grep newcs | grep -v grep | grep -v $0 | wc -l` -gt 0 ]; then
echo "and also newcs is running"
echo $LINE
ps ax | grep newcs | grep -v grep | grep -v $0
else
echo "and newcs is not running"
fi
echo $LINE
if [ ! -f /etc/rc3.d/S95cardserver.sh ]; then
echo "autostart is disabled"
echo $LINE
else
if [ `ls -al /etc/rc3.d/S95cardserver.sh | grep $CAMBIN.sh | wc -l` -gt 0 ]; then
echo "autostart of $CAMNAME is enabled"
echo $LINE
else
echo "autostart of $CAMNAME is disabled"
echo $LINE
fi
fi
if [ -f /tmp/ecm.info ]; then
echo "ECM info"
echo $LINE
cat /tmp/ecm.info
echo $LINE
fi
if [ -f /tmp/cardinfo ]; then
echo "Card info"
echo $LINE
cat /tmp/cardinfo
echo $LINE
fi
;;
autostart | enable)
echo $LINE
echo "[SCRIPT] $1: $CAMNAME"
echo $LINE
ln -sfn /usr/script/$CAMBIN.sh /etc/rc3.d/S95cardserver.sh
;;
noautostart | disable)
echo $LINE
echo "[SCRIPT] $1: $CAMNAME"
echo $LINE
rm /etc/rc3.d/S95cardserver.sh > /dev/null 2>&1
;;
*)
echo "Usage: $0 start|stop|restart|info|enable|disable"
exit 1
;;
esac
exit 0