Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: vdr Restarting Tool (cron Job + Perl)



Dein Text:
>> Maybe one could telnet to port 2001 on localhost. If there is no reaction
>> within a certain time limit, it's most likely that vdr is gone.
> 

> I am wondering if this tool (might be a perl script) already exists. Does
> anybody know one ?
> Otherwise i have to start my brain for a coding session.


Here is my solution:

>#!/bin/sh
># erstellt: 130102 Matthias Lötzke
># umgeschrieben für vdr 170502 Matthias
>
> if !(/opt/dvb/VDR/svdrpsend.pl HELP | grep "SVDRP VideoDiskRecorder" &>/dev/null); then
>        if [ -f /var/run/keinvdr ]; then
>                sleep 10
>                if !(/opt/dvb/VDR/svdrpsend.pl HELP | grep "SVDRP VideoDiskRecorder" &>/dev/null); then
>                        date +"[%D %T] vdr neugestartet!" >> /var/log/vdr
>                        /etc/init.d/video restart &>/dev/null
>                fi
>                rm -f /var/run/keinvdr
>        else
>                touch /var/run/keinvdr
>                date +"[%D %T] vdr reagiert nicht!" >> /var/log/vdr
>        fi
>else
>        if [ -f /var/run/keinvdr ]; then
>                rm -f /var/run/keinvdr
>        fi
>fi


Matthias.





Home | Main Index | Thread Index