Skip to content

Commit 10db44d

Browse files
author
Adam Young
committed
Use ip instead of ifconfig.
Should work on F16, F17 and Debian based systesm. Change-Id: I22dd10097baebf6e7e396fcbf5e68a3dae63539f
1 parent cb7aaf3 commit 10db44d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stack.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ SCHEDULER=${SCHEDULER:-nova.scheduler.filter_scheduler.FilterScheduler}
251251
HOST_IP_IFACE=${HOST_IP_IFACE:-eth0}
252252
# Use the eth0 IP unless an explicit is set by ``HOST_IP`` environment variable
253253
if [ -z "$HOST_IP" -o "$HOST_IP" == "dhcp" ]; then
254-
HOST_IP=`LC_ALL=C /sbin/ifconfig ${HOST_IP_IFACE} | grep -m 1 'inet addr:'| cut -d: -f2 | awk '{print $1}'`
254+
HOST_IP=`LC_ALL=C ip -f inet addr show ${HOST_IP_IFACE} | awk '/inet/ {split($2,parts,"/"); print parts[1]}' | head -n1`
255255
if [ "$HOST_IP" = "" ]; then
256256
echo "Could not determine host ip address."
257257
echo "Either localrc specified dhcp on ${HOST_IP_IFACE} or defaulted to eth0"

0 commit comments

Comments
 (0)