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