OSCAM Script required

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • choakem
    Newbie
    • Dec 2009
    • 14

    #1

    OSCAM Script required

    Hi guys hopefully you can help...

    I have a script that checks to see if OSCAM is running and restarts if required - this works fine.

    Every now and again OSCAM will detect no card in my smargo card reader but continues to run normally and this is not detected by my current script. If I browse to http://server-ip:8888/graph.svg?type=servers then my card is detected as IDLE.

    Is there a script to detect this IDLE state and restart OSCAM?

    Any advice or help would be appreciated.

    Here is my current oscam-check script.

    !/bin/sh
    process=`ps auxwww | grep oscam | grep -v grep | awk '{print $1}'`
    if [ -z "$process" ]; then
    echo "Couldn't find Oscam running. Restarting server-binary" >> /var/cccamlog/o$
    echo && date >>/var/cccamlog/oscam.check
    /usr/local/bin/oscam >> /var/cccamlog/Oscam.log &
    else echo "Oscam_1.00 is still OK!" >> /var/cccamlog/oscam.check
    fi
  • davvo
    DK Veteran
    • Apr 2009
    • 666

    #2
    this is for dream elite phoenix edition
    the script runs another script then oscam starts
    it works perfect

    edit the parts in yellow to suit your image


    Code:
    #!/bin/sh
    #Script to check if OSCAM is running.
    process=`ps auxwww | grep [COLOR=Yellow]oscam[/COLOR] | grep -v grep | awk '{print $1}'`
    if [ -z "$process" ]; then
    echo "Couldn't find OSCAM running Restarting OSCAM Server" >> /var/log/oscam.check
    echo && date >> /var/log/oscam.check
    else
    [COLOR=Yellow]/usr/camscript/Ncam_oscam.sh start[/COLOR]
    echo "OSCAM is still OK!" >> /var/log/oscam.check
    fi
    Last edited by davvo; 29 April, 2012, 09:12.

    Comment

    • choakem
      Newbie
      • Dec 2009
      • 14

      #3
      This script works only if OSCAM has stopped working - My issues were more along that the script was working fine but my card remained idle and all ECM requests were denied.
      I went through the logs and found the following:-

      "rejected group (0 ms) (of 0 avail 0) (no matching reader)"

      I created a script called ServerOK.sh
      if tail -8 /var/log/oscam.log |grep -v grep |grep -c matching>/dev/null
      then
      echo restart server
      /sbin/shutdown now -r
      else
      echo running ok
      fi

      It fairly basic but I added this to my crontab to run every 5 mins. Seems to work fine. Every time my card seems to stop answering ECM request then I reboot the server. Happens once every couple of days. I could have just restarted OSCAM I suppose but thats easy to change.

      hopefully this mayhelp others that encountered this problem with OSCAM.

      It simply checke my oscam log file for the word "matching" which seems to be a unique word for my issues in the log file.

      So far it been up for a week and no issues have been encountered.

      Comment

      • Manic01
        Banned
        • Dec 2008
        • 5117

        #4
        Took a while to reply
        At elast it seems ok now.
        Well done.

        Comment

        • ITS A SCAM !
          DK Veteran
          • Oct 2008
          • 1140

          #5
          Sorry to dig up this old thread, does anyone know if this will work on a raspberry Pi running oscam ??

          Comment

          Working...