Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save binarytemple/d94a070983159a4a2870 to your computer and use it in GitHub Desktop.
Save binarytemple/d94a070983159a4a2870 to your computer and use it in GitHub Desktop.
cat /Library/Preferences/VMware\ Fusion/networking

VERSION=1,0
answer VNET_1_DHCP no
answer VNET_1_DHCP_CFG_HASH 94C7DBE1652600E11F176EB31E5DF6517EFD8EDC
answer VNET_1_HOSTONLY_NETMASK 255.255.255.0
answer VNET_1_HOSTONLY_SUBNET 192.168.108.0
answer VNET_1_VIRTUAL_ADAPTER yes
answer VNET_8_DHCP yes
answer VNET_8_DHCP_CFG_HASH DD22913272501D6863B3A9B6957CC578A0727FA4
answer VNET_8_HOSTONLY_NETMASK 255.255.255.0
answer VNET_8_HOSTONLY_SUBNET 192.168.103.0
answer VNET_8_NAT yes
answer VNET_8_VIRTUAL_ADAPTER yes
x=File.readlines("/Library/Preferences/VMware\ Fusion/networking")
x2=x.grep(/VNET_1_HOSTONLY_SUBNET/)
oct1,oct2,oct3,oct4  = x2[0].match(/answer VNET_1_HOSTONLY_SUBNET[^0-9]*([0-9]*).([0-9]*).([0-9]*).([0-9]*)/i).captures
["192", "168", "108", "0"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment