mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
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>
This commit is contained in:
1 parent
d0caf30ebb
commit
458dbeddf3
1 file changed
+1
-1
@@ -113,7 +113,7 @@ function handle_iptable()
|
||||
#
|
||||
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,/.*,,'
|
||||
}
|
||||
|
||||
|
||||
|
||||