Re: get-boot-info

Szilard Matyas-Szegedi <[email protected]>
Newsgroups gmane.linux.debian.fai
Message-ID <CAMSZtCoUEbJ46px0WiP5Fy-n5HB=1dF-DiWK-_sWMEY7B5bMqA@mail.gmail.com>
I might be missing something, but I don't see why that wait/poll section is
necessary as in the next section you poll for default route to be available
which will only be available if at least an interface other than loopback
with an IP address is up. Of course theoretically it is possible that
someone sets the default route manually pointing to the loopback interface.
:) But in that case boot.log will not be filled with or without waiting for
first active interface as NIC1 is empty. So I would simply remove that
section and keep only dummy variable. Let me know your thoughts.

Orig:
   # first get first active network device
    local dev dummy n

    n=0
    until [ $n = 7 ]; do
dev=$(ip ad show up | awk -F': ' '/^[0-9]/ && ! / lo:/ {print $2;exit}')
if [ -z "$dev" ]; then
            sleep 2 # if interface needs some time to come up
else
   break
fi
n=$(($n + 1))
    done

Proposed:
local dummy

Kind Regards,
Szilard
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.