[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Auto-choose ethernet card
- To: misc_(_at_)_openbsd_(_dot_)_org
- Subject: Re: Auto-choose ethernet card
- From: Marcus Popp <marcus_(_dot_)_popp_(_at_)_paranoidbsd_(_dot_)_org>
- Date: Fri, 1 Apr 2005 08:06:30 +0000
On 2005-03-31T21:54, Henning Brauer wrote:
> * Marcus Popp <marcus_(_dot_)_popp_(_at_)_247net_(_dot_)_de> [2005-03-31 19:06]:
> > Hi Gaby,
> >
> > On 2005-03-31T15:07, Gaby vanhegan wrote:
> > ...
> > > Then it's an actual interface. Surely there must be a cleaner way to
> > > do this?
> >
> > you _could_ use the following line, it shows the "plugged" NICs
> > and it works for me ...
> >
> > ifconfig -a | grep -B 2 baseTX | grep -e "^[a-z]" | cut -d ':' -f 1
>
> yeah great
> will sure match
> media: Ethernet autoselect (1000baseT full-duplex)
> or links at 10BaseT or Fibre cards or all those incapable of reporting
> link state
cmon i think you can handle the matching string. Of course you could
adapt it to your needs. Of course you could grep all physical devices,
but what if the computer has multiple NICs and only one is connected?
Marcus.
Visit your host, monkey.org