adlogix / docker-machine-nfs

Activates NFS on docker-machine
MIT License
794 stars 104 forks source link

Bug with 10 or more virtualbox network adapters #71

Closed febbraro closed 7 years ago

febbraro commented 7 years ago

We found an interesting edge case today when using this script with a VirtualBox instance that has more than 10 hostonly interfaces. VirtualBox names the interfaces vboxnet1, vboxnet2...etc all the way to vboxnet10, vboxnet11.

Since it does not pad it's interface numbers with 01, 02 this allows the following line to grab too many IPs.

VBoxManage list hostonlyifs | grep "${prop_network_id}" -A 3 | grep IPAddress | cut -d ':' -f2 | xargs

This will grab multiple IPs because the grep clause will match on vboxnet1, vboxnet10, vboxnet11. The way we were able to fix this is by changing the grep to be this, grep "${prop_network_id}$" -A 3

I will work on getting this to you in a PR.

febbraro commented 7 years ago

Pull request in #72