Register
Results 1 to 5 of 5
  1. #1
    Newbie
    Join Date
    Dec 2009
    Posts
    14
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    1
    Thanked in
    1 Post

    Default 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

  2. #2
    DK Veteran
    Join Date
    Apr 2009
    Posts
    666
    Thanks Thanks Given 
    1
    Thanks Thanks Received 
    12
    Thanked in
    12 Posts

    Default

    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 oscam | 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
    /usr/camscript/Ncam_oscam.sh start
    echo "OSCAM is still OK!" >> /var/log/oscam.check
    fi
    Last edited by davvo; 29th April, 2012 at 09:12 AM.

  3. #3
    Newbie
    Join Date
    Dec 2009
    Posts
    14
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    1
    Thanked in
    1 Post

    Default

    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.

  4. #4
    Banned
    Join Date
    Dec 2008
    Posts
    5,117
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    6
    Thanked in
    6 Posts

    Default

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

  5. #5
    DK Veteran ITS A SCAM !'s Avatar
    Join Date
    Oct 2008
    Location
    In my own little world...tra la la
    Posts
    1,140
    Thanks Thanks Given 
    38
    Thanks Thanks Received 
    9
    Thanked in
    8 Posts

    Default

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

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.