Nice work, will give it a play.
No idea if this is useful to anyone else but I just whipped up a sysV init script for the x86 CCcam binary. I use 2.0.8 but it should work for any of them if you point it at the correct binary and config file.
In short, it's a clean / faster way to start, stop and restart CCcam on a stand alone linux box (not a dreambox). It also comes up on boot without resorting to the ugly rc.local file. It's a very simple implementation but is redhat init.d compliant. My setup is a phoenix interface in the com port of a CentOS linux box using CCcam 2.0.8 (x86) sharing an EN-DE-S card to my dreamboxes.
To install it, just create a file called /etc/init.d/CCcamd and paste in the script below. Make sure the config and binary variables at the top match your locations. I kept mine in the default spots /var/bin and /var/etc. Then install it using the command "chkconfig --add CCcamd"
You can then start, stop and restart the server using the redhat service command. For example: "service CCcamd restart" or just run the script directly with start, stop or restart switches.
Code:#!/bin/sh # Uncomment the following to debug #set -x ## CCcamd startup script # chkconfig: 2345 11 30 # description: CCcamd 2.0.8 sysv startup script for redhat based distros . /etc/rc.d/init.d/functions CCCAM="/var/bin/CCcam_2.0.8" CCCAM_CONFIG="/var/etc/CCcam.cfg" LOCKFILE="/var/lock/subsys/CCcamd" start() { # Start CCcam server echo -n "Starting CCcamd" if [ -f $LOCKFILE ] ; then echo echo -ne "Lock file exists. Try a restart" echo_failure ; echo exit -1 fi $CCCAM -C $CCCAM_CONFIG touch $LOCKFILE echo_success ; echo } stop() { echo -n "Stopping CCcamd" killproc $CCCAM rm -f $LOCKFILE echo_success ; echo } debug() { set -x start } case "$1" in start) start ;; stop) stop ;; restart) stop start ;; debug) debug ;; *) echo $"Usage: $0 {start|stop|restart}" esac exit
Last edited by mortsamis; 14-05-08 at 02:49 PM. Reason: Spelling and it's probably still bad..
Look Here -> |
Nice work, will give it a play.
Nice work.
Question just out of curiosity at what speed are you running phoenix 6mhz or 3.5. I also run centos 5 server however can't get phoenix going with CCCam 2.08 for some reasons.
I can get CCcam going at 3.57 but nothing I do can get it going at 6 using newcs or cccam. I don't know if it's my phoenix or the linux box but I intend to do a test using newcs at 6mhz under windows (god forbid).
=)
I have fixed that script up a little too to fire into interactive mode when you run a debug instead of debugging the script itself. Posted below.
Code:#!/bin/sh # Uncomment the following to debug #set -x ## CCcamd startup script # chkconfig: 2345 11 30 # description: CCcamd 2.0.8 sysv startup script for redhat based distros . /etc/rc.d/init.d/functions CCCAM="/var/bin/CCcam_2.0.8" CCCAM_CONFIG="/var/etc/CCcam.cfg" LOCKFILE="/var/lock/subsys/CCcamd" start() { # Start CCcam server echo -n "Starting CCcamd" if [ -f $LOCKFILE ] ; then echo echo -ne "Lock file exists. Try a restart instead." echo_failure ; echo exit -1 fi $CCCAM -C $CCCAM_CONFIG -f touch $LOCKFILE echo_success ; echo } stop() { echo -n "Stopping CCcamd" killproc $CCCAM rm -f $LOCKFILE echo_success ; echo } debug() { echo -n "Starting CCcamd (Debug Mode)" ; echo if [ -f $LOCKFILE ] ; then echo echo -ne "Lockfile exists. Restarting in debug mode" sleep 2 killproc $CCCAM rm -f $LOCKFILE $CCCAM -C $CCCAM_CONFIG -f -d echo_success ; echo fi $CCCAM -C $CCCAM_CONFIG -f -d echo_success ; echo } case "$1" in start) start ;; stop) stop ;; restart) stop start ;; debug) debug ;; *) echo $"Usage: $0 {start|stop|status|restart}" esac exit
I know it's easy to go and spend 50euro on smargo but there is no fun in it. I know for a fact that you can run CCcam @ 6MHZ with the other readers.
Not sure if I'd call "fun" trying to get something working that doesn't as stated many times.
Your right though, cccam will work with a phoenix at 6mhz. With irdeto NOT nds.
But if you can get it going be sure to come back and tell us. There are lots of people here that would be interested to know how.
Is anyone selling smargos in au ?
Hey mortsamis
Thank you for the script very handy. Do you know if I can add "service CCcamd stop" & "service CCcamd start" to a .sh script? if yes in what format?
I am wanting to stop CCcam at say 3 am copy a new CCcam.cfg then start it again. I have my .sh and crontab jobs set & working I just need to stop & start CCcam.x86.
By the way your script works with Clarkconnect distro.
Cheers
[QUOTE=mortsamis;47877]I can get CCcam going at 3.57 but nothing I do can get it going at 6 using newcs or cccam. I don't know if it's my phoenix or the linux box but I intend to do a test using newcs at 6mhz under windows (god forbid).
=)
I have fixed that script up a little too to fire into interactive mode when you run a debug instead of debugging the script itself. Posted below.
The quieter you become, the more you are able to hear
Hi STI12,
Those commands should just work in a script you launch from crontab. If you hre having issues with it, maybe it just needs a full path to the service command?
On my CentOS distro, it's in /sbin
/sbin/service cccam stop
/sbin/service cccam start
Should do it.. Hope that helps.
Thanks mate
Will give a try tonight
Cheers
The quieter you become, the more you are able to hear
Junior Member
Bookmarks