get-boot-info
Szilard Matyas-Szegedi
szilard.matyas at gmail.com
Tue Dec 10 15:50:55 CET 2019
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.uni-koeln.de/pipermail/linux-fai/attachments/20191210/c4dd2b46/attachment.html>
More information about the linux-fai
mailing list