Results 1 to 7 of 7

Thread: Oscam auto restart DM-500

  1. #1
    Super Moderator turbopower's Avatar
    Join Date
    02-07-2011
    Location
    Somewhere between the Streams
    Posts
    3,512
    Uploads
    112

    Lightbulb Oscam auto restart DM-500

    1. Правим файл oscamctrl в /var/bin със съдържание

    Code:
    #!/bin/sh 
    CAMNAME="Oscam Server" 
    # end 
    # This method starts Oscam 
    start_cam () 
    { 
    killall -9 oscam 2>/dev/null
    sleep 2 
    /var/bin/oscam  & 
    } 
    # This method stops Oscam 
    stop_cam () 
    { 
    killall -9 oscam 2>/dev/null
    } 
    case "$1" in 
    start) 
    echo "[SCRIPT] $1: $CAMNAME" 
    start_cam 
    ;; 
    stop) 
    echo "[SCRIPT] $1: $CAMNAME" 
    stop_cam 
    ;; 
    restart) 
    echo "Restaring $CAMNAME" 
    stop_cam 
    sleep 7 
    start_cam 
    ;; 
    *) 
    "$0" stop 
    exit 1 
    ;; 
    esac 
    exit 0
    /var/bin/oscam е пътя до изпълнимият файл

    2. Правим файл oscamrst в /var/bin със съдържание.

    Code:
    #!/bin/sh 
    if ! ps x |grep -v grep |grep -c /var/bin/oscam >/dev/null 
    then 
    /var/bin/oscamctr start 
     echo `date "+%d/%m/%y %R process was not working"` >> /var/log/oscam_restart_log
    # This part above will check if there is NO oscam process running. 
    # And if this condition it truth, it will start it and write to log. 
    # Log entry will contain time stamp and reason of execution (process not working) 
    # If first condition in not truth (oscam was running), go further to next condition. 
    elif 
    tail -8 /tmp/oscam.log |grep -v grep |grep -c ins40 >/dev/null 
    then 
    /var/bin/oscamctr restart 
    echo `date "+%d/%m/%y %R ins40 error detected"` >> /tmp/oscam_bul_restart_log 
    elif 
    tail -8 /tmp/oscam.log |grep -v grep |grep -c trylock >/dev/null 
    then 
    /var/bin/oscamctr restart 
    echo `date "+%d/%m/%y %R trylock error detected"` >> /tmp/oscam_bul_restart_log  
    # Those 2 conditions will look for 2 common errors in Oscam: "ins40" and "trylock" 
    # If last 8 lines of your oscam.log contain any of those errors, it will restart oscam. 
    # Log entries will include the exact reason of restart. 
    # ins40 error is random error that will keep oscam running but no CWs returned. 
    # trylock is older error that appear if you use CCcam protocol in oscam.server 
    else 
    echo "ok" 
    # If oscam passes all conditions and all is OK, it will simply echo "ok" :-) 
    fi 
    # ENJOY - supermariocs
    3. Най-важната част е във вашият oscam.conf в секцията global да имате добавено

    Code:
    logfile                       = /tmp/oscam.log
    4. Активирате crond и във файла /etc/cron/crontabs/root добавяте:

    Code:
    * * * * * /var/bin/oscamrst >/dev/null 2>&1
    Запомняте промените и рестартирате бокса.

    Това е цялата работа, първоначалната идея е на supermariocs с някой промени от моя страна.

    Ако смятате, че ръководството ви е помогнало кликнете върху иконката, която е като звездичка под поста ми.

  2. #2
    Super Moderator turbopower's Avatar
    Join Date
    02-07-2011
    Location
    Somewhere between the Streams
    Posts
    3,512
    Uploads
    112

    Re: Oscam auto restart DM-500

    Quote Originally Posted by kadarka View Post
    точка 4 къде се поставя
    Във файла "/etc/cron/crontabs/root" както е написано.

  3. #3
    Senior Member kaizera82's Avatar
    Join Date
    29-07-2006
    Location
    In the darkness
    Posts
    195
    Uploads
    4

    Re: Oscam auto restart DM-500

    А къде да зададем часът в който да се резетва?

  4. #4
    Senior Member
    Join Date
    06-08-2011
    Location
    London / Пловдив
    Posts
    147
    Uploads
    0

    Re: Oscam auto restart DM-500

    * * * * * /var/bin/oscamrst >/dev/null 2>&1

    Звездичките са както следва :
    минута (0-59), час (0-23, 0 = Полунощ), ден (1-31), месец (1-12), делничен (0-6, 0 = Неделя) /var/bin/oscamrst >/dev/null 2>&1

  5. #5
    Senior Member kaizera82's Avatar
    Join Date
    29-07-2006
    Location
    In the darkness
    Posts
    195
    Uploads
    4

    Re: Oscam auto restart DM-500

    Ако искам всеки ден, примерно във 23:00 часа да се рестартира, то ва означава ли че всеки ден трябва да променям ден (1-31), делничен (0-6, 0 = Неделя)

  6. #6
    Senior Member
    Join Date
    06-08-2011
    Location
    London / Пловдив
    Posts
    147
    Uploads
    0

    Re: Oscam auto restart DM-500

    0 23 * * * /var/bin/oscamrst >/dev/null 2>&1


    http://www.pantz.org/software/cron/croninfo.html

  7. #7
    Senior Member kaizera82's Avatar
    Join Date
    29-07-2006
    Location
    In the darkness
    Posts
    195
    Uploads
    4

    Re: Oscam auto restart DM-500

    Вдянах, благодаря.

Similar Threads

  1. CCcam / oscam Check - Restart
    By wahid in forum OSCam
    Replies: 4
    Last Post: 23-06-2013, 18:41:03
  2. OScam Windows setup (Auto Install package)
    By ALFAJAY in forum OSCam Tools
    Replies: 0
    Last Post: 27-06-2011, 20:41:55
  3. Tutorial CCcam Auto Restart Script
    By totox69 in forum Information et Tutoriels
    Replies: 4
    Last Post: 28-03-2011, 12:53:23
  4. Replies: 1
    Last Post: 20-12-2009, 15:50:40
  5. Question Auto Restart Problem with my Startsat 5300CU Super?
    By tarata300 in forum Starsat
    Replies: 0
    Last Post: 01-07-2009, 15:46:25

Tags for this Thread

Posting Permissions

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