From 10db44dea85202465e50abc88403cb8af9bc248d Mon Sep 17 00:00:00 2001 From: Adam Young Date: Thu, 31 May 2012 20:18:53 -0400 Subject: [PATCH] Use ip instead of ifconfig. Should work on F16, F17 and Debian based systesm. Change-Id: I22dd10097baebf6e7e396fcbf5e68a3dae63539f --- stack.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stack.sh b/stack.sh index fcefbde4d4..f21c92f718 100755 --- a/stack.sh +++ b/stack.sh @@ -251,7 +251,7 @@ SCHEDULER=${SCHEDULER:-nova.scheduler.filter_scheduler.FilterScheduler} HOST_IP_IFACE=${HOST_IP_IFACE:-eth0} # Use the eth0 IP unless an explicit is set by ``HOST_IP`` environment variable if [ -z "$HOST_IP" -o "$HOST_IP" == "dhcp" ]; then - HOST_IP=`LC_ALL=C /sbin/ifconfig ${HOST_IP_IFACE} | grep -m 1 'inet addr:'| cut -d: -f2 | awk '{print $1}'` + HOST_IP=`LC_ALL=C ip -f inet addr show ${HOST_IP_IFACE} | awk '/inet/ {split($2,parts,"/"); print parts[1]}' | head -n1` if [ "$HOST_IP" = "" ]; then echo "Could not determine host ip address." echo "Either localrc specified dhcp on ${HOST_IP_IFACE} or defaulted to eth0"