DM800 HD Oscam / CCcam check script help

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

  • Folks,


    Good day. Have been going around in circles, trying to get a oscam / cccam check script working, as my oscam has been crashing twice a day at odd hours


    I first tried the script that checks the "web interface" but when i run the script i get an error that "curl" does not exist. Not sure how to extract the curl file from the library, and which library, so instead am now trying the one that checks the process.


    The script below doesn't seem to be working, because if i manually stop oscam, and then run the script oscam doesn't start up. The funny thing is if i run the four commands manually via telnet (kill oscam, kill cccam, start oscam, start cccam) , it works and oscam and cccam does start, but via the script it doesn't work


    This is what i have so far


    #!/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/log/oscam.check
    nohup killall CCcam_2.3.0 >> /var/log/oscam.log &
    nohup killall oscam-v8a >> /var/log/oscam.log &
    nohup oscam-v8a -b >> /var/log/oscam.log &
    nohup CCcam_2.3.0 >> /var/log/oscam.log &
    #sh /usr/script/Oscam_v8a_cs.sh
    #sh /usr/script/CCcam_2.3.0_em.sh
    else
    echo "oscam is still OK!" >> /var/log/oscam.check
    fi



    Any help is appreciated


    regards

  • Ok guys, i'm almost there....


    After alot of reading, and testing, it seems i was trying to do too much. Since i'm running oscam and cccam, i thought that if oscam crashes, i would need to kill both oscam and cccam and then restart both, but seems not.


    When oscam crashes, cccam still keeps on running (in my case at least). The only reason you would want to stop cccam and then start oscam first and cccam second, is so that cccam doesn't grab the reader before oscam. ( i think)


    So when my oscam was crashing, and cccam was still running, the reader was still in oscam's hands (so to speak). So all i'm doing in the script is killall oscam, (just to be sure, oscam is dead), and then restarting oscam with -b.


    My other problem was creating the cron job. That took a while. Was puting cron files all over trying different directoris, and then figured out that editing the root cron file in /var/spool/cron/crontabs did the trick. Now my sh file is running every 5 min.


    My final problem is that i have to run crond through telnet for the scripts to work. But if i have to reboot my DM800 then the scripts won't run any more, because crond is not starting automatically.


    So need to figure out how to get the DM800 to start crond on boot up...

  • Oops, just noticed the banner at the top, mentioning that this section is for working scripts only. Mod, please feel free to move to correct section....


    Just an FYI to folks on my posts above, i did finally manage to get crond startup after reboot. Per the previous post, i did have issues with cron and getting scripts to execute, and secondly getting crond to startup automatically after a reboot. Found a site, that was sharing info on how it would work with Red Hat / Ubuntu and linux versions on PC...


    The one that worked for me was


    update-rc.d crond defaults


    Regards

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!