get-boot-info

Szilard Matyas-Szegedi <[email protected]>
Newsgroups gmane.linux.debian.fai
Message-ID <CAMSZtCpYQeK+UJRY=sF3_+=fmhgJdN8LxBPxH5LDhPrHWd0aFg@mail.gmail.com>
Hi Thomas,

I don't know all particular aspects of the FAI design and I wouldn't like
to have a say in how things should work. But in a particular case when
interface with a proper IP setting (with default gw) is happen to the
second interface and there is a dummy IP setting on the first active
interface, variables like IPADDR, NETMASK, BROADCAST are filled and
erroneously used with dummy IP info of the first active interface. I know
it is not possible to cover every custom need of the users, but probably
using IP settings of the default interface if available would be better.


Original:

 if [ -z "$NIC1" ]; then
        NIC1=$(ip route | awk '/ dev / {print $3}'|head -1)
fi

read IPADDR NETMASK BROADCAST dummy<<<$(ifdata -p $dev)
CIDR=$(ip -o -f inet addr show| awk '{print $4}'| grep $IPADDR)
GATEWAYS=$(ip route | awk '/^default/ {print $3}')

Please, consider this instead:

 if [ -n "$NIC1" ]; then
        read IPADDR NETMASK BROADCAST dummy<<<$(ifdata -p $NIC1)
else
        NIC1=$(ip route | awk '/ dev / {print $3}'|head -1)
        read IPADDR NETMASK BROADCAST dummy<<<$(ifdata -p $dev)
fi
CIDR=$(ip -o -f inet addr show| awk '{print $4}'| grep $IPADDR)
GATEWAYS=$(ip route | awk '/^default/ {print $3}')

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.