[mythtv-users] channel changing/tuning
Remco Treffkorn
remco at rvt.com
Mon Aug 13 19:02:26 UTC 2007
On Sunday 12 August 2007, R. G. Newbury wrote:
...
>
> The trick is then to change database to a 'proper' channel. The
> following script should do the trick. I call my version
> 'start-chan-reset'. You can hardcode the channel and card values, in
> which case only the last three lines are necessary.
>
> **************************************
> #!/bin/bash
> Channel=abc
> Card=xyz
> Channel=$1
> Card=$2
>
> echo "Args provided: Channel: " $Channel " Card: " $Card
> if [ $1 = abc ];
> then
> echo "You must provide a channel number."
> exit;
> fi
> if [ $2 = xyz ];
> then
> echo "Need to give a Card number."
> exit;
> fi
>
> echo 'update cardinput set startchan = '$1' where cardinputid = '$2' >
> /var/tmp/startchanfix
> mysql -u mythtv -pmythtv mythconverg < /var/tmp/startchanfix
> rm -f /var/tmp/startchanfix
...
Your checking for supplied arguments does not work. Please remove the last two
lines (the ones actually trying to do anything) and run your script:
./script abc xyz
./script abc
./script xyz
./script
You will notice how broken it is.
Cheers,
Remco
--
Remco Treffkorn (RT445)
HAM DC2XT
remco at rvt.com (831) 685-1201
More information about the mythtv-users
mailing list