#!/bin/bash number="$1" if [ -z "$number" ] then number="1" fi if [ "$number" == "0" ] then file="$HOME/.mplayer/channels.conf" count=1 while read line do if [ -n "$line" ] then channel=$(cat ~/.mplayer/channels.conf | sed -n "$count"p | cut -f 1 -d ':') count=$(($count+1)) channel_query+=("dvb://$channel" ) fi done < "$file" /usr/bin/mplayer -cache 4096 -dvbin timeout=5 "${channel_query[@]}" else echo "number: $number" channel=$(cat ~/.mplayer/channels.conf | sed -n "$number"p | cut -f 1 -d ':') # there are startup problems and syncronization issues, any solutions? echo "command: /usr/bin/mplayer -cache 4096 -dvbin timeout=5 dvb://$channel" /usr/bin/mplayer -cache 4096 -dvbin timeout=5 dvb://"$channel" fi sleep 1 exit # debugging: mplayer -dumpfile ~/dump-1.ts -dumpstream dvb://"Nederland 1(Digitenne)" lftp open ftp://upload.mplayerhq.hu/MPlayer/incoming/ put dump-1.ts dump-2.ts dump-3.ts dump-4.ts