Watchdog (Oscam): Unterschied zwischen den Versionen

Aus Tutorials
Zur Navigation springen Zur Suche springen
Zeile 71: Zeile 71:
vi /usr/script/oscam_watchdog.sh
vi /usr/script/oscam_watchdog.sh
</pre>
</pre>
VTi Team Image:


<pre>
<pre>
Zeile 81: Zeile 83:
else
else
   /usr/script/oscam_1.20-unstable-11682_cam.sh restart > /dev/null
   /usr/script/oscam_1.20-unstable-11682_cam.sh restart > /dev/null
  echo -e "OSCAM restarted at `date`" | mailx -A kirner.or.at -s "OSCAM restarted" admin@kirner.or.at
   echo "OSCAM restarted at `date`" >> /tmp/crash-log-oscam.log
   echo "OSCAM restarted at `date`" >> /tmp/crash-log-oscam.log
  echo -e "OSCAM receiver-hofstetten restarted at `date`" | mailx -A kirner.or.at -s "OSCAM receiver-hofstetten restarted" admin@kirner.or.at
fi
</pre>
OpenATV:
<pre>
#!/bin/bash
PID=$(pidof /usr/bin/oscam-trunk)
if (kill -0 $PID 2>/dev/null)
then
  echo "it's alive!" > /dev/null
else
  /etc/init.d/softcam.oscam-trunk restart > /dev/null
  echo "OSCAM restarted at `date`" >> /tmp/crash-log-oscam.log
  echo -e "OSCAM of receiver-seestadt restarted at `date`" | mailx -A kirner.or.at -s "OSCAM of receiver-seestadt restarted" admin@kirner.or.at
fi
fi
</pre>
</pre>

Version vom 4. September 2023, 19:09 Uhr

Noch in Bearbeitung


verwandte Themen

Siehe auch: Startup-Scripte, Mails versenden (Enigma2)

Raspberry

Noch in Bearbeitung


PID ermitteln

pidof /usr/local/bin/oscam

Script

sudo vi /usr/local/bin/oscam_watchdog.sh
#!/bin/bash

PIDFILE=/var/run/oscam.pid
if (kill -0 `cat $PIDFILE`)
 then
 echo "it's alive!" > /dev/null
 else
 rm $PIDFILE
 /usr/local/bin/oscam start > /dev/null
 echo "OSCAM restarted at `date`" >> /var/log/oscam-crash.log
fi
sudo chmod +x /usr/local/bin/oscam_watchdog.sh

Receiver

Noch in Bearbeitung


Startscript ermitteln

Der Befehl

ls -la /etc/init.d/

sollte einen Eintrag wie folgenden ausgeben:

current_cam.sh -> /usr/script/oscam_1.20-unstable-11682_cam.sh

PID ermitteln

pidof oscam_1.20-unstable-11682

Script

vi /usr/script/oscam_watchdog.sh

VTi Team Image:

#!/bin/bash

PID=$(pidof oscam_1.20-unstable-11682)
if (kill -0 $PID 2>/dev/null)
then
  echo "it's alive!" > /dev/null
else
  /usr/script/oscam_1.20-unstable-11682_cam.sh restart > /dev/null
  echo "OSCAM restarted at `date`" >> /tmp/crash-log-oscam.log
  echo -e "OSCAM receiver-hofstetten restarted at `date`" | mailx -A kirner.or.at -s "OSCAM receiver-hofstetten restarted" admin@kirner.or.at
fi

OpenATV:

#!/bin/bash

PID=$(pidof /usr/bin/oscam-trunk)
if (kill -0 $PID 2>/dev/null)
then
  echo "it's alive!" > /dev/null
else
  /etc/init.d/softcam.oscam-trunk restart > /dev/null
  echo "OSCAM restarted at `date`" >> /tmp/crash-log-oscam.log
  echo -e "OSCAM of receiver-seestadt restarted at `date`" | mailx -A kirner.or.at -s "OSCAM of receiver-seestadt restarted" admin@kirner.or.at
fi
chmod +x /usr/script/oscam_watchdog.sh

Init-Script erstellen

ln -sf /usr/script/oscam_watchdog.sh /etc/init.d/oscam_watchdog.sh
ln -sf /usr/script/oscam_watchdog.sh /etc/rc3.d/S99oscam_watchdog.sh

Links

http://raspberry.tips/raspberrypi-tutorials/oscam-watchdog-fuer-den-raspberry-pi/


Zurück zu OSCam_(Raspberry), OSCam_(Satreceiver)