Oscam monitor restart Script

There are 2 replies in this Thread which was already clicked 3,528 times. The last Post () by yinyang.

  • script is checking the Oscam, also the CCcam.
    is super good , and simple to use ,.....
    no folder of trash, --with confirmation of status,-- something that you need to delete , (empty ) after each day.


    #################################
    #CCcamcheck.sh or ccheck.sh
    ##################################


    IP="127.0.0.1"
    ERRORLOG="/tmp/error.log"


    #CCcam Options#########
    CCCAMPORT="12000" #
    CCCAMVERSION="_2.1.4" # here you modify according to your needs, that your box have
    CCCAMPATH="/usr/bin/" #
    #######################


    #oscam Options#########
    OSCAMPORT="34000" #
    OSCAMVERSION="_0.99.4"#### or 1.10,....
    OSCAMPATH="/usr/bin/" #
    #######################
    CCCAMCHECK=nc $IP $CCCAMPORT
    OSCAMCHECK=nc $IP $OSCAMPORT
    if [ $CCCAMCHECK = ]
    then
    echo && date >> $ERRORLOG
    echo "CCcam is frozen, restarting CCcam" >> $ERRORLOG
    killall CCcam$CCCAMVERSION
    killall oscam$OSCAMVERSION


    $OSCAMPATH && oscam && $OSCAMVERSION &
    sleep 15
    $CCCAMPATH && CCcam && $CCCAMVERSION &


    else
    echo "Cccam is responding like it should"
    fi


    if [ $OSCAMCHECK = ]
    then
    echo && date >> $ERRORLOG
    echo "oscam is frozen, restarting CCcam" >> $ERRORLOG
    killall CCcam$CCCAMVERSION
    killall oscam$OSCAMVERSION


    $OSCAMPATH && oscam && $OSCAMVERSION &
    sleep 15
    $CCCAMPATH && CCcam && $CCCAMVERSION &


    else
    echo "oscam is responding like it should"
    fi




    ####################


    cronjob ----for 1 minute in crontabs root


    */1 * * * * /usr/script/ccheck.sh
    or
    */1 * * * * /usr/script/ccheck.sh start


    start the cron, for this script from cronmanager that you will find
    Meniu>pluin>cronmanager


    or with DCC >telnet , commands
    crontab -e with DCC


    verify process is running-- Command : PS also in DCC telnet


    bye


    locations of folders


    usr/script/ccheck.sh


    etc/cron/crontanbs

  • Script with Feedback , monitor OSCAM , and CCcam
    works like a clock,...



    #############################################
    #!/bin/bash
    #############################################


    process=`ps auxwww | grep oscam | grep -v grep | awk '{print $1}'`


    if [ -z '$process' ];


    then


    echo "Couldn't find oscam running. Restarting server-binary"
    echo "Couldn't find oscam running. Restarting server-binary" >> /var/log/oscam.check
    #nohup /usr/bin/oscam_r4396 >> /var/log/oscam.log &


    /usr/bin/killall -9 oscam_r5893
    /usr/bin/oscam_r5893 &



    else


    echo " OK 1!" >> /var/log/oscam.check
    echo "oscam is still OK!" #aceasta linie o afiseaza doar pe Ecran, prima are calea spre folder oscam.check


    fi




    ##################################


    founds=`tail -10 /var/log/oscam.log | grep "ins40" | wc -l`
    founds2=`tail -10 /var/log/oscam.log | grep "classD0" | wc -l`
    founds3=`tail -20 /var/log/oscam.log | grep "(-2)" | wc -l`


    if [ $founds -gt 3 ] || [ $founds2 -ge 1 ] || [ $founds3 -ge 1 ]


    then


    echo "Error found, restart Oscam";
    echo "Error found, restart Oscam" >> /var/log/oscam.check
    /usr/bin/killall -9 oscam_r5893
    /usr/bin/oscam_r5893 &


    else


    echo "oscam still ok 2";
    echo "ok 2!" >> /var/log/oscam.check


    fi



    #################


    if ps x |grep -v grep |grep -c usr/bin/CCcam >/dev/null


    #or


    #if ps x |grep -v grep |grep -c CCcam_2.1.3 >/dev/null
    #if ps x |grep -v grep |grep -c CCcam >/dev/null


    then


    echo "CCcam ok"
    echo "CCcam ok" >> /var/log/CCcam.check



    else


    echo "CCcam restarting"
    echo "CCcam restarting" >> /var/log/CCcam.check



    /usr/bin/killall -9 CCcam_2.1.3
    /usr/bin/CCcam_2.1.3 &


    fi

OSCam Support Forum

Configs, discussion, downloads and guides for OSCam Softcam.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!