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:
emellor@leeni.uk.xensource.com committed 2005-12-08 15:54:35 +00:00
1 parent d0caf30ebb
commit 458dbeddf3
1 file changed
+1 -1
+1 -1
View File
@@ -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,/.*,,'
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.