#!/bin/bash stations='ARD ZDF Südwest_3 Bayern_3 DRS 3sat arte' stations_num='2 3 4 6 9 16 23' [ $1 ] && TV2HTML_DIR=$1 if [ ! -d "$TV2HTML_DIR" ]; then echo 'Usage: gettv ' exit 1 fi for station in $stations; do num="$stations_num" num="${num%% *}" stations_num="${stations_num#* }" echo -ne "Prepare station $station ($num). Press to start or enter 's' to skip: \\a" read if [ "$REPLY" != s ]; then touch $TV2HTML_DIR/$station.db pages= case $station in ARD|ZDF|Südwest_3|Bayern_3) pages="361.0 362.0 363.0 364.0 365.0 366.0 367.0";; DRS) pages="371.0 372.0 373.0 374.0 375.0 376.0 377.0";; 3sat) pages="330.0 331.0 332.0 333.0 334.0 335.0 336.0";; arte) pages="351.0 352.0 353.0 354.0 355.0 356.0 357.0";; esac if [ "$pages" = "" ]; then echo Unknown station: $station else vtxget -p $station -o $TV2HTML_DIR -f text $pages 2>&1 | tee $TV2HTML_DIR/vtxget.log if grep -q timeout $TV2HTML_DIR/vtxget.log; then echo -e Warning: timeouts occured:\\a grep timeout $TV2HTML_DIR/vtxget.log fi rm -f $TV2HTML_DIR/vtxget.log fi fi done