2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-29 17:23:08 +00:00

hardeths: when multiple default routes are defined, only select one

This commit is contained in:
Kilian Cavalotti 2018-07-27 15:29:19 -07:00
parent a9d48dc251
commit e37b462c42

View File

@ -50,7 +50,7 @@ if [ -f /etc/os-release ] && (cat /etc/os-release |grep -i '^NAME=[ "]*Cumulus
OSVER="cumulus"
fi
defgw=`ip route | grep default | awk '{print $3}'`
defgw=`ip route | grep default | awk '{print $3}' | head -n1`
if ( pmatch $OSVER "ubuntu*" ) || (pmatch $OSVER "cumulus")
then
echo `hostname` >/etc/hostname