#!/bin/sh # # Author: Nicolas GUILLAUME # # usage: mplayer-scan-dvb zone where zone is something like fr-Nancy (for Nancy in France...) # Zones are in /usr/share/dvb/dvb-t/ # Scan only if the channels.conf file for the zone does not exist. # ZPREFIX=dvb-t ZPATH="/usr/share/dvb/$ZPREFIX/$1" CPATH="channels.$1.conf" if [ "$1" = "" ] then echo "usage: mplayer-scan-dvb " >&2 echo " where zone is in " >&2 cd $ZPATH ls exit fi cd ~/.mplayer [ -s "$CPATH" ] || rm "$CPATH" if ! [ -r "$CPATH" ] then echo "Scanning $1..." if ! [ -r "$ZPATH" ] then echo "unable to open $ZPATH" >&2 exit 1 fi dvbscan "$ZPATH" > "$CPATH" else echo "Scan already done." fi rm channels.conf ln -s "$CPATH" channels.conf echo "$1 activated. Available services:" grep BANDWIDTH "$CPATH" | cut -d: -f1