Add delay between starts.

This commit is contained in:
Tom Alexander 2025-08-23 23:56:39 -04:00
parent 313c159a3e
commit 54060aada6
No known key found for this signature in database
GPG Key ID: D3A179C9A53C0EDE

View File

@ -85,15 +85,18 @@ function main {
function start {
local num_vms="$#"
if [ "$num_vms" -gt 0 ]; then
for name in "$@"; do
log "Starting VM $name."
start_one "$name"
done
else
if [ "$num_vms" -eq 0 ]; then
log "No VMs specified."
return 0
fi
while [ "$#" -gt 0 ]; do
local name="$1"
shift 1
log "Starting VM $name."
start_one "$name"
[ "$#" -eq 0 ] || sleep 5
done
}
function start_one {
@ -115,15 +118,18 @@ export -f launch_pidfile
function stop {
local num_vms="$#"
if [ "$num_vms" -gt 0 ]; then
for name in "$@"; do
log "Stopping VM $name."
stop_one "$name"
done
else
if [ "$num_vms" -eq 0 ]; then
log "No VMs specified."
return 0
fi
while [ "$#" -gt 0 ]; do
local name="$1"
shift 1
log "Stopping VM $name."
stop_one "$name"
[ "$#" -eq 0 ] || sleep 5
done
}
function stop_one {