@@ -60,6 +60,7 @@ Options:
60
60
-m, --mount-opts NFS mount options (default to 'noacl,async')
61
61
-i, --use-ip-range Changes the nfs export ip to a range (e.g. -network 192.168.99.100 becomes -network 192.168.99)
62
62
-p, --ip Configures the docker-machine to connect to your host machine via a specific ip address
63
+ -t, --timeout Configures how long the timeout should be for docker-machine commands
63
64
64
65
Examples:
65
66
@@ -137,7 +138,7 @@ setPropDefaults()
137
138
prop_mount_options=" noacl,async"
138
139
prop_force_configuration_nfs=false
139
140
prop_use_ip_range=false
140
- prop_use_ip =
141
+ prop_timeout =
141
142
}
142
143
143
144
# @info: Parses and validates the CLI arguments
@@ -183,6 +184,10 @@ parseCli()
183
184
prop_use_ip=" ${i#* =} "
184
185
;;
185
186
187
+ -t=* |--timeout=* )
188
+ prop_timeout=" -t ${i#* =} "
189
+ ;;
190
+
186
191
* )
187
192
echoError " Unknown argument '$i ' given"
188
193
echo # EMPTY
@@ -220,7 +225,7 @@ checkMachinePresence ()
220
225
{
221
226
echoInfo " machine presence ... \t\t\t"
222
227
223
- if [ " " = " $( docker-machine ls | sed 1d | grep -w " $1 " ) " ]; then
228
+ if [ " " = " $( docker-machine ls $2 | sed 1d | grep -w " $1 " ) " ]; then
224
229
echoError " Could not find the machine '$1 '!" ; exit 1;
225
230
fi
226
231
@@ -234,7 +239,7 @@ checkMachineRunning ()
234
239
{
235
240
echoInfo " machine running ... \t\t\t"
236
241
237
- machine_state=$( docker-machine ls | sed 1d | grep " ^$1 \s" | awk ' {print $4}' )
242
+ machine_state=$( docker-machine ls $2 | sed 1d | grep " ^$1 \s" | awk ' {print $4}' )
238
243
239
244
if [ " Running" != " ${machine_state} " ]; then
240
245
echoError " The machine '$1 ' is not running but '${machine_state} '!" ;
@@ -249,7 +254,7 @@ checkMachineRunning ()
249
254
# @return: The driver used to create the machine
250
255
getMachineDriver ()
251
256
{
252
- docker-machine ls | sed 1d | grep " ^$1 \s" | awk ' {print $3}'
257
+ docker-machine ls $2 | sed 1d | grep " ^$1 \s" | awk ' {print $3}'
253
258
}
254
259
255
260
# @info: Loads mandatory properties from the docker machine
@@ -259,7 +264,7 @@ lookupMandatoryProperties ()
259
264
260
265
prop_machine_ip=$( docker-machine ip $1 )
261
266
262
- prop_machine_driver=$( getMachineDriver $1 )
267
+ prop_machine_driver=$( getMachineDriver $1 " $2 " )
263
268
264
269
if [ " $prop_machine_driver " = " vmwarefusion" ]; then
265
270
prop_network_id=" Shared"
@@ -504,10 +509,10 @@ setPropDefaults
504
509
505
510
parseCli " $@ "
506
511
507
- checkMachinePresence $prop_machine_name
508
- checkMachineRunning $prop_machine_name
512
+ checkMachinePresence $prop_machine_name " $prop_timeout "
513
+ checkMachineRunning $prop_machine_name " $prop_timeout "
509
514
510
- lookupMandatoryProperties $prop_machine_name
515
+ lookupMandatoryProperties $prop_machine_name " $prop_timeout "
511
516
512
517
if [ " $( isNFSMounted) " = " true" ] && [ " $prop_force_configuration_nfs " = false ]; then
513
518
echoSuccess " \n NFS already mounted." ; showFinish ; exit 0
0 commit comments