Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
# Used for setting the `smb_host` in config.vm.synced_folder
def get_host_ip
# This example uses `ifconfig` and `grep` to find inet interface and host IP address
host_ip = `ifconfig | grep "inet " | grep -v 127.0.0.1 | awk '{print $2}'`.strip
# Excludes loopback and link-local (169.254.x.x) addresses, and takes only the first match
# in case multiple interfaces are active (e.g. Wi-Fi + VPN).
host_ip = `ifconfig | grep "inet " | grep -v 127.0.0.1 | grep -v 169.254 | awk '{print $2}'`.split("\n").first
return host_ip
end

Expand Down
Loading