From 73d605d9ad5e3a60e7c690d891d5b20d4f714ff3 Mon Sep 17 00:00:00 2001 From: Tomas-M Date: Wed, 31 Jul 2019 07:53:07 +0200 Subject: [PATCH] PXE: Use first route IP if multiple routes are found --- Slax/debian/rootcopy/usr/bin/pxe | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Slax/debian/rootcopy/usr/bin/pxe b/Slax/debian/rootcopy/usr/bin/pxe index 97b7e9c..3aaff4e 100755 --- a/Slax/debian/rootcopy/usr/bin/pxe +++ b/Slax/debian/rootcopy/usr/bin/pxe @@ -9,7 +9,7 @@ FTPROOT=/var/state/dnsmasq/root # find out our own IP address. If more interfaces are available, use the first one IP="$(hostname -I | cut -d " " -f 1)" -GW=$(ip route show | grep default | grep -o "via.*" | cut -d " " -f 2) +GW=$(ip route show | grep default | grep -o "via.*" | head -n 1 | cut -d " " -f 2) # if no IP is assigned to this computer, setup private address randomly if [ "$IP" = "" ]; then