Mailing List Archive

Fix ip_of to cope with interfaces with multiple addresses, courtesy of
# HG changeset patch
# User emellor@leeni.uk.xensource.com
# Node ID e64e28e36e02ddcef1e5f0d398f649e2d869302e
# Parent c9772105fead52abf64213aa1eda6419871acf94
Fix ip_of to cope with interfaces with multiple addresses, courtesy of
Adam Heath <doogie@brainfood.com>.

Signed-off-by: Ewan Mellor <ewan@xensource.com>

diff -r c9772105fead -r e64e28e36e02 tools/examples/vif-common.sh
--- a/tools/examples/vif-common.sh Thu Dec 8 15:04:41 2005
+++ b/tools/examples/vif-common.sh Thu Dec 8 15:54:35 2005
@@ -113,7 +113,7 @@
#
function ip_of()
{
- ip addr show "$1" | sed -n 's/^.*inet \([0-9.]*\).*$/\1/p'
+ ip addr show "$1" | awk "/^.*inet.*$1\$/{print \$2}" | sed 's,/.*,,'
}



_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xensource.com
http://lists.xensource.com/xen-changelog