Bug#514916: Slightly better way.

2009-02-19 Thread Robin Lee Powell
On Thu, Feb 19, 2009 at 09:19:02AM +, Chris Lamb wrote:
> Robin Lee Powell wrote:
> 
> > +   for nic in $(ifconfig -a | grep '^[^ ]' | grep -v '^lo' |
> >sed 's/ .*//' | tr '\012' ' ')
> 
> That's horrible. What's wrong with:
> 
>  for IF in /sys/class/net/*
>  do
>  # ...
>  done

I always forget about /sys; sorry.  You still need to drop lo,
though.

-Robin


-- 
They say:  "The first AIs will be built by the military as weapons."
And I'm thinking:  "Does it even occur to you to try for something
other than the default outcome?" -- http://shorl.com/tydruhedufogre
http://www.digitalkingdom.org/~rlpowell/ *** http://www.lojban.org/



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#514916: Slightly better way.

2009-02-19 Thread Chris Lamb
Robin Lee Powell wrote:

> +   for nic in $(ifconfig -a | grep '^[^ ]' | grep -v '^lo' |
>sed 's/ .*//' | tr '\012' ' ')

That's horrible. What's wrong with:

 for IF in /sys/class/net/*
 do
 # ...
 done


Regards,

-- 
  ,''`.
 : :'  : Chris Lamb
 `. `'`  la...@debian.org
   `-


signature.asc
Description: PGP signature


Bug#514916: Slightly better way.

2009-02-18 Thread Robin Lee Powell

I'm now working on etch FAI, and ran into a totally different set of
bugs.

-_-

As a side effect, I've come up with a more general (in the sense of
working with the older stuff), faster way of dealing with the
multiple ethernet thing.  It stops when any one NIC is done.

--- live.orig   2009-02-19 06:03:28.0 +
+++ live2009-02-19 06:07:01.0 +
@@ -635,11 +635,17 @@
udevtrigger
udevsettle

-   ipconfig ${DEVICE} | tee /netboot.config
+   while [ ! "$(ifconfig -a | grep -v 127.0.0.1 | grep 'inet addr:')" ]
+   do
+   for nic in $(ifconfig -a | grep '^[^ ]' | grep -v '^lo' | sed 
's/ .*//' | tr '\012' ' ')
+   do
+   ipconfig -t 5 $nic
+   done
+   done

# source relevant ipconfig output
OLDHOSTNAME=${HOSTNAME}
-   . /tmp/net-${DEVICE}.conf
+   . /tmp/net-*.conf
[ -z ${HOSTNAME} ] && HOSTNAME=${OLDHOSTNAME}
export HOSTNAME

-Robin

-- 
They say:  "The first AIs will be built by the military as weapons."
And I'm thinking:  "Does it even occur to you to try for something
other than the default outcome?" -- http://shorl.com/tydruhedufogre
http://www.digitalkingdom.org/~rlpowell/ *** http://www.lojban.org/



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org