|
54 | 54 | #
|
55 | 55 | # REFERENCE:
|
56 | 56 | #
|
57 |
| -# system('scripts/before-vagrant.sh') |
| 57 | +# File.write('IP', "10.10.10.#{rand(10..250)}") if not File.exists?('IP') |
58 | 58 | #
|
59 |
| -# This line calls a `before-vagrant.sh` script to be run |
60 |
| -# before any other part of `Vagrantfile` is run. |
61 |
| -# |
62 |
| -# Currently this script generates a random non-routable IP |
63 |
| -# address starting with 10 and randomly selects from 0..254 |
64 |
| -# for the remaining three octets. It then writes the IP |
| 59 | +# This line creates a randomly-generated and non-routable IP |
| 60 | +# address starting with 10.10.10. and randomly selects the |
| 61 | +# final octet between 10 and 250. It then writes the IP |
65 | 62 | # address to a file named 'IP' in the project's root folder
|
66 | 63 | # which is the same folder where this Vagrantfile is found
|
67 |
| -# to ensure future runs of "vagrant up" or "vagrant reload" |
| 64 | +# to ensure future runs of "vagrant up" or "vagrand reload" |
68 | 65 | # will use the same IP address.
|
69 | 66 | #
|
70 | 67 | # The assumption here is that it is very unlikely that this
|
|
79 | 76 | # choose to at least evaluate WPLib Box, although someone
|
80 | 77 | # may occasionally need to debug why it is not working.
|
81 | 78 | #
|
82 |
| -# If we can find a better approach, we will be happy to |
83 |
| -# to switch to it later. Suggestions welcome. |
| 79 | +# If we can find a better approach later, we will be happy |
| 80 | +# to switch to it. |
84 | 81 | #
|
85 | 82 | # config.vm.box = "wplib/wplib"
|
86 | 83 | #
|
|
255 | 252 |
|
256 | 253 | Vagrant.configure(2) do |config|
|
257 | 254 |
|
258 |
| - system('scripts/before-vagrant.sh') |
| 255 | + File.write('IP', "10.10.10.#{rand(10..250)}") if not File.exists?('IP') |
259 | 256 |
|
260 | 257 | config.vm.box = "wplib/wplib"
|
261 | 258 | config.vm.hostname = "wplib.box"
|
|
0 commit comments