#!/bin/bash
#
# minimal dvbd-http-streaming client for use with xinetd.
#
# type can be "dvb-s" "dvb-c" or "dvb-t"
TYPE="dvb-t"
read D GET D

GET="`echo -e ${GET//\%/\\\\x}`"
GET=${GET#/}

echo HTTP/1.1 200 OK
echo "Date: `LANG=C date '+%a, %d %b %Y %T GMT'`"
echo "Server: dvbcat-network (seife)"
echo "Connection: close"
echo "Content-Type: video/mpeg"
echo
exec dvbcat -p 9 $TYPE "$GET"
