Results 1 to 12 of 12

Thread: CCcam (x86) init script for redhat based distros

  1. #1
    Junior Member mortsamis's Avatar
    Join Date
    May 2008
    Age
    45
    Posts
    43
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Rep Power
    195
    Reputation
    10

    Default CCcam (x86) init script for redhat based distros

    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 ->
  • #2
    Senior Member z80's Avatar
    Join Date
    Jan 2008
    Posts
    5,840
    Thanks
    112
    Thanked 77 Times in 48 Posts
    Rep Power
    0
    Reputation
    708

    Default

    Nice work, will give it a play.

  • #3
    Junior Member zumka's Avatar
    Join Date
    Feb 2008
    Posts
    143
    Thanks
    2
    Thanked 5 Times in 5 Posts
    Rep Power
    201
    Reputation
    40

    Default

    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.

  • #4
    Premium Member

    Join Date
    Jan 2008
    Posts
    1,920
    Thanks
    361
    Thanked 804 Times in 379 Posts
    Rep Power
    376
    Reputation
    5712

    Default

    Quote Originally Posted by zumka View Post
    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.
    Zumka, that's 3 different threads plus another forum ;-) where you've asked about cccam running nds in a phoenix at 6mhz. It simply doesn't work mate.

  • #5
    Junior Member mortsamis's Avatar
    Join Date
    May 2008
    Age
    45
    Posts
    43
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Rep Power
    195
    Reputation
    10

    Default

    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

  • #6
    Junior Member zumka's Avatar
    Join Date
    Feb 2008
    Posts
    143
    Thanks
    2
    Thanked 5 Times in 5 Posts
    Rep Power
    201
    Reputation
    40

    Default

    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.

  • #7
    Premium Member

    Join Date
    Jan 2008
    Posts
    1,920
    Thanks
    361
    Thanked 804 Times in 379 Posts
    Rep Power
    376
    Reputation
    5712

    Default

    Quote Originally Posted by zumka View Post
    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.

  • #8
    Junior Member zumka's Avatar
    Join Date
    Feb 2008
    Posts
    143
    Thanks
    2
    Thanked 5 Times in 5 Posts
    Rep Power
    201
    Reputation
    40

    Default

    Is anyone selling smargos in au ?

  • #9
    Premium Member

    Join Date
    Jan 2008
    Posts
    1,920
    Thanks
    361
    Thanked 804 Times in 379 Posts
    Rep Power
    376
    Reputation
    5712

    Default

    Quote Originally Posted by zumka View Post
    Is anyone selling smargos in au ?

  • #10
    Junior Member STI02's Avatar
    Join Date
    Jan 2008
    Location
    Oz
    Posts
    180
    Thanks
    12
    Thanked 0 Times in 0 Posts
    Rep Power
    204
    Reputation
    10

    Question

    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

  • #11
    Junior Member mortsamis's Avatar
    Join Date
    May 2008
    Age
    45
    Posts
    43
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Rep Power
    195
    Reputation
    10

    Default

    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.

  • #12
    Junior Member STI02's Avatar
    Join Date
    Jan 2008
    Location
    Oz
    Posts
    180
    Thanks
    12
    Thanked 0 Times in 0 Posts
    Rep Power
    204
    Reputation
    10

    Thumbs up

    Thanks mate

    Will give a try tonight

    Cheers
    The quieter you become, the more you are able to hear

  • 08-03-09, 12:24 PM

    Reason
    spam

  • Bookmarks

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •