2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-18 20:30:56 +00:00

Make dhclient to get IP for Primary nic instead of static eth0

This commit is contained in:
WangXiaoPeng
2015-07-06 03:15:05 -04:00
parent f320262f7c
commit 0dba62260c

View File

@ -38,7 +38,7 @@ fi
IP=$(ip addr show dev $PRINIC | grep inet | grep -v inet6 | awk '{print $2}' | head -n 1 | awk -F '/' '{print $1}')
if [ -z $IP ]
then
dhclient eth0
dhclient $PRINIC
#IP=$(ifconfig $PRINIC | grep inet | awk '{print $2}' | awk -F: '{print $2}')
IP=$(ip addr show dev $PRINIC | grep inet | grep -v inet6 | awk '{print $2}' | head -n 1 | awk -F '/' '{print $1}')
fi