On 14-Feb-08 11:53:57, Barry Samuels wrote:
My MythTV box doesn't have a keyboard or monitor and could be moved between TV aerial points. It has two network cards so can connect via cable or wireless.
Is there any way, at boot time, to get it to try the cable interface first and then, perhaps after a given time, to try the wireless interface and to keep trying both interfaces until it does find a connection?
-- Barry Samuels http://www.beenthere-donethat.org.uk The Unofficial Guide to Great Britain
You say "can connect" -- but what to?
If you had a specific IP address to connect to, you could run a script at boot which (assuming your two cards are on eth0 and eth1) switched the routing table back & forth between eth0 and eth1 (say with a "sleep 2" between switches) and tried to ping that IP address.
The test would be on the lines of
if [ ping -1 ip.add.re.ss ] ; then exit
(or whatever)
Or you could ping one address when on eth0 and another on eth1.
The basic lines of such a script would be (stuff in "{...}" is "metalanguage" -- i.e. the details are up to you ... )
{set route to eth0} while true ; do sleep 2 {delete eth0 route and set route to eth1} if [ ping -1 ip.add.re.ss1 ] ; then exit {delete eth1 route and set eth0} sleep 2 if [ ping -1 ip.add.re.ss0 ] ; then exit done
("sleep 2" is just a guess, of course).
Ted.
-------------------------------------------------------------------- E-Mail: (Ted Harding) Ted.Harding@manchester.ac.uk Fax-to-email: +44 (0)870 094 0861 Date: 14-Feb-08 Time: 12:38:27 ------------------------------ XFMail ------------------------------