AW: Startscript für oscam
Das script ist ein Dauerläufer und prüft alle "60" Sekunden ob oscam läuft und restartet bei Bedarf !
-----------------------------------------------
#!/bin/sh
# oscam Watchdog
#INTERVALL in seconds, 60 = 1 minute
INTERVALL=60
oscamVers=oscam
while true
time=$(date +%A", "%d-%m-%Y" @ "%H:%M:%S)
if [ "$(ps | grep -v grep | grep -c $oscam)" == "0" ]; then
#oscam neu starten
/usr/bin/$oscam & > /dev/null
echo "$time - restart $oscam " >> /tmp/oscamWD.restarts
else
echo "$time - $oscam still running" > /tmp/oscamWD.log
fi
do
sleep $INTERVALL
done
exit 0
--------------------------------------------
Und was ist das Problem !
Und sollte die Box aus irgend einen Grund nue starten wird auch oscam neu gestartet!
Allerdings das script mit cron jede Minute checken ist dann komplett abgesichert !
---------------------------------------------
#!/bin/sh
# oscam Watchdog
oscamVers=oscam
time=$(date +%A", "%d-%m-%Y" @ "%H:%M:%S)
if [ "$(ps | grep -v grep | grep -c $oscam)" == "0" ]; then
#oscam neu starten
/usr/bin/$oscam & > /dev/null
echo "$time - restart $oscam " >> /tmp/oscamWD_restarts.log
else
echo "$time - $oscam still running" > /tmp/oscamWD.log
fi
------------------------------------------------