1. Правим файл oscamctrl в /var/bin със съдържание
/var/bin/oscam е пътя до изпълнимият файл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
2. Правим файл oscamrst в /var/bin със съдържание.
3. Най-важната част е във вашият oscam.conf в секцията global да имате добавено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
4. Активирате crond и във файла /etc/cron/crontabs/root добавяте:Code:logfile = /tmp/oscam.log
Запомняте промените и рестартирате бокса.Code:* * * * * /var/bin/oscamrst >/dev/null 2>&1
Това е цялата работа, първоначалната идея е на supermariocs с някой промени от моя страна.
Ако смятате, че ръководството ви е помогнало кликнете върху иконката, която е като звездичка под поста ми.




Reply With Quote

