Skip to content

Instantly share code, notes, and snippets.

@mike-neck
Created July 12, 2011 06:41
Show Gist options
  • Save mike-neck/1077510 to your computer and use it in GitHub Desktop.
Save mike-neck/1077510 to your computer and use it in GitHub Desktop.
get InetAddress
import java.net.*;
NetworkInterface.getNetworkInterfaces().each{nInterface ->
println 'display name : ' + nInterface.getDisplayName()
nInterface.getInetAddresses().each{addr ->
address = addr.getHostAddress()
println 'address : ' + address
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment