#!/bin/bash #Launch the TV #nice -4 cat /dev/video0 | DISPLAY=:0.0 nice -4 xine stdin:/ >> /dev/null 2>&1 & #mplayer /dev/video0 & #Check if cat is already running #TEST=`ps aux|grep "cat /dev/video0"|grep -v grep` #if [ "$TEST" != "" ] #then # killall cat # killall xine #fi #TUNE="ptune.pl -f pal-europe-west -d /dev/video -F" TUNE="ivtv-tune –device=/dev/video0 -teurope-west -f" ${TUNE} 487.250 #nice -4 cat /dev/video0 | DISPLAY=:0.0 nice -4 xine -B -G 240x180+1360+1 stdin:/ >> /dev/null 2>&1 & DISPLAY=:0.0 nice -4 mplayer /dev/video0 >> /dev/null 2>&1 & bold=`tput bold;tput setaf 4` offbold=`tput sgr0` red=`tput setaf 1` green=`tput setaf 2` yellow=`tput setaf 3` blue=`tput setaf 4` purlple=`tput setaf 5` cyan=`tput setaf 6` white=`tput setaf 7` CHOICE () { clear SELECT="NO" echo "${yellow}1${offbold}TV1 ${yellow}7${offbold}BBC1 ${yellow}2${offbold}Canvas ${yellow}8${offbold}BBC2 ${yellow}3${offbold}VTM ${yellow}9${offbold}NatGeo ${yellow}4${offbold}K2 ${yellow}0${offbold}Vitaya ${yellow}5${offbold}VT4 ${yellow}-${offbold}More ${yellow}6${offbold}TV5 ${yellow}q${offbold}${red}uit${offbold}" read -s -n1 KEY case "$KEY" in 1) FREQ=487.250 ;; 2) FREQ=607.250 ;; 3) FREQ=217.250 ;; 4) FREQ=479.250 ;; 5) FREQ=238.250 ;; 6) FREQ=175.250 ;; 7) FREQ=252.250 ;; 8) FREQ=703.250 ;; 9) FREQ=543.250 ;; 0) FREQ=712.250 ;; -) CHOICE_2 ;; q) killall mplayer ; exit;; esac $TUNE $FREQ >> /dev/null } CHOICE_2 () { clear SELECT="YES" echo "${yellow}1${offbold}ROB ${yellow}7${offbold}ARTE ${yellow}2${offbold}CNBC ${yellow}8${offbold}Jim ${yellow}3${offbold}BBC W ${yellow}9${offbold}TMF ${yellow}4${offbold}NL 1 ${yellow}0${offbold}MCM ${yellow}5${offbold}NL 2 ${yellow}-${offbold}More ${yellow}6${offbold}NL 3 ${yellow}q${offbold}${red}uit${offbold}" read -s -n1 KEY case "$KEY" in 1) FREQ=671.250 ;; 2) FREQ=552.250 ;; 3) FREQ=224.250 ;; 4) FREQ=196.250 ;; 5) FREQ=210.250 ;; 6) FREQ=687.250 ;; 7) FREQ=133.250 ;; 8) FREQ=266.250 ;; 9) FREQ=648.250 ;; 0) FREQ=245.250 ;; -) CHOICE ;; q) killall mplayer ; exit;; esac $TUNE $FREQ >> /dev/null } SET=NO while [ "$SET" = "NO" ] do if [ "$SELECT" = "YES" ] then CHOICE_2 else CHOICE fi done exit