#!/bin/sh
while (true) do
xine --fullscreen --hide-gui vdr://tmp/vdr-xine/stream#demux:mpeg_pes
if test $? -eq 0 -o $? -eq 2; then exit; fi   #chks if prev call exited with 0 or 2, then exit.
#  $@  = is all parameters
#  $#  = number of parameters provided
#  0 = successful exit
#  !0 = non-successful.  number is usually selected by process i.e. 'exit 2'
#  1 = catch-all errors.  i.e. divide/0
#  2 = misuse of shell bullitens - seldom seen.  Or CTRL-C
#  126 = Command invoked cannot execute.  Permission problem or non-executable
#  127 = Command not found
date
echo "restarting Xine"
/usr/local/bin/killxine.sh
sleep 10
date
done
#xine --fullscreen --hide-gui vdr://tmp/vdr-xine/stream#demux:mpeg_pes
