Add delay between starts.
This commit is contained in:
parent
313c159a3e
commit
54060aada6
@ -85,15 +85,18 @@ function main {
|
|||||||
|
|
||||||
function start {
|
function start {
|
||||||
local num_vms="$#"
|
local num_vms="$#"
|
||||||
|
if [ "$num_vms" -eq 0 ]; then
|
||||||
|
log "No VMs specified."
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$num_vms" -gt 0 ]; then
|
while [ "$#" -gt 0 ]; do
|
||||||
for name in "$@"; do
|
local name="$1"
|
||||||
|
shift 1
|
||||||
log "Starting VM $name."
|
log "Starting VM $name."
|
||||||
start_one "$name"
|
start_one "$name"
|
||||||
|
[ "$#" -eq 0 ] || sleep 5
|
||||||
done
|
done
|
||||||
else
|
|
||||||
log "No VMs specified."
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function start_one {
|
function start_one {
|
||||||
@ -115,15 +118,18 @@ export -f launch_pidfile
|
|||||||
|
|
||||||
function stop {
|
function stop {
|
||||||
local num_vms="$#"
|
local num_vms="$#"
|
||||||
|
if [ "$num_vms" -eq 0 ]; then
|
||||||
|
log "No VMs specified."
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$num_vms" -gt 0 ]; then
|
while [ "$#" -gt 0 ]; do
|
||||||
for name in "$@"; do
|
local name="$1"
|
||||||
|
shift 1
|
||||||
log "Stopping VM $name."
|
log "Stopping VM $name."
|
||||||
stop_one "$name"
|
stop_one "$name"
|
||||||
|
[ "$#" -eq 0 ] || sleep 5
|
||||||
done
|
done
|
||||||
else
|
|
||||||
log "No VMs specified."
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function stop_one {
|
function stop_one {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user