#!/bin/bash
DBOX_IP="192.168.100.15"
PIDS=`GET http://dbox/control/zapto?getpids`
pid=""
for i in $PIDS
do
pid=$pid"0x"`printf %0x $i`" "

xine -pwhq http://"$DBOX_IP":31339/$pid --no-splash --no-logo 2>&1 > /dev/null &
pidold=$pid
XINE=`ps auxww | grep "xine -pwhq http:" | egrep -v grep | awk '{print $11}'`
while [ "$XINE" = "xine" ]
do
PIDS=`GET http://dbox/control/zapto?getpids`
pid=""
for i in $PIDS
do
pid=$pid"0x"`printf %0x $i`" "

if [ "$pid" != "$pidold" ]
then
ps auxww | grep "xine -pwhq http:" | egrep -v grep | awk '{print $2}' | xargs kill -9 > /dev/null 2>&1
sleep 3
xine -pwhq http://"$DBOX_IP":31339/$pid --no-splash --no-logo 2>&1 > /dev/null &
fi
pidold=$pid
sleep 5
XINE=`ps auxww | grep "xine -pwhq http:" | egrep -v grep | awk '{print $11}'`

Wenn's jemand brauchen kann..... Verbesserungsvorschlägen bin ich immer offen.
Tschau
Matthias