updated on Sat Jan 14 00:11:12 UTC 2012
[aur-mirror.git] / alevt-dvb / TeletextDVB-capture.sh
blob41fc9b4487f33673941a7eee362f30a196d931ef
1 #!/bin/bash
2 ## Author Heinrich Schwietering (2009)
3 ## Script to start a dvb-t supporting version of AleVT
4 ## Modified and translated by Heiko Baums (2009)
6 MCD=/usr/bin/alevt-cap
8 zenity --help > /dev/null || { echo "Error: You need \"zenity\" to use this script." && exit 1 ; }
9 test -e $MCD || { zenity --error --text "Error: You need \"aleVT\" with dvb support to use this script." && exit 1 ; }
10 test ! -e ~/TeletextPIDS.lst && zenity --error --text "~/TeletextPIDS.lst not found" && exit 1
11 STATION=`cat ~/TeletextPIDS.lst | cut -d ";" -f 1 | zenity --list --title "Please select a station" --column "Station:"` || exit 0
12 test "$STATION" || { zenity --error --text "No station selected." && exit 1 ; }
13 PID=`grep "$STATION" ~/TeletextPIDS.lst | cut -d ";" -f 2`
14 PAGE=`zenity --entry --title "Please enter a page number" --text "Enter the page and subpage (ppp[.ss])"` || exit 0
15 test "$PAGE" || { zenity --error --text "No page number entered." && exit 1 ; }
16 FORMAT=`zenity --list --title "Please select a format" --column "Format" ascii ansi html ppm png` || exit 0
17 test "$FORMAT" || { zenity --error --text "No format selected." && exit 1 ; }
18 FILENAME=`zenity --title "Please select a file for saving the page" --file-selection --save` || exit 0
19 test "$FILENAME" || { zenity --error --text "No file chosen." && exit 1 ; }
20 $MCD -name "$FILENAME" -format $FORMAT -vbi /dev/dvb/adapter0/demux0 -pid $PID $PAGE > /dev/null
21 zenity --info --text "Teletext page captured."