Hi my oscam sumtime ecm timeout so i have to restart oscam, is there ant script can? help thanks you
There are 2 replies in this Thread which was already clicked 917 times. The last Post () by djrikstar333.
-
-
Adjust to your liking
Bash
Display More#!/bin/sh remove_tmp () { rm -rf /tmp/.oscam /media/usb/oscam/* } case "$1" in start) remove_tmp sleep 3 exec start-stop-daemon -S -x /usr/bin/oscam -- -b -r 2 -c /etc/tuxbox/config/oscam exit ;; stop) exec start-stop-daemon -K -R 2 -x /usr/bin/oscam & sleep 2 killall -9 oscam 2>/dev/null sleep 2 remove_tmp sleep 2 exit ;; restart|reload) $0 stop sleep 1 $0 start ;; version) echo "6686" ;; info) echo "oscam6686" ;; *) echo "Usage: $0 start|stop|restart" exit 1 ;; esac exit 0
-
Put this code in a file called "check_os" inside the folder where oscam binary is. Make sure you change the file directories to suit and also chmod it.
Also make sure you have a oscript in the oscam folder as well.
I had issue with timeouts now and again but since put this in been all good.Bash
Display More#!/bin/bash if ! ps x |grep -v grep |grep -c /emu/oscam/oscam.x86 >/dev/null then oscript 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 /var/log/oscam.log |grep -v grep |grep -c ins40 >/dev/null then oscript restart echo `date "+%d/%m/%y %R ins40 error detected"` >> /var/log/oscam_restart_log elif tail -8 /var/log/oscam.log |grep -v grep |grep -c deadlock >/dev/null then oscript restart echo `date "+%d/%m/%y %R deadlock error detected"` >> /var/log/oscam_restart_log # Those 2 conditions will look for 2 common errors in Oscam: "ins40" and "deadlock" # 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. # deadlock 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
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!