Files
mtusi2026lab3/scripts/start-api.sh
T
2026-10-13 19:11:11 +03:00

16 lines
542 B
Bash

#!/bin/sh
# Восстановление после stop-one.sh: запускает остановленные API-реплики и ждёт healthy.
set -eu
. "$(dirname "$0")/lib.sh"
all=$(service_ids api -a)
running=$(service_ids api)
started=""
for id in $all; do
case " $running " in *" $id "*) continue ;; esac
docker start "$id" >/dev/null
started="$started $id"
echo "started api container $(short "$id")"
done
[ -z "$started" ] || wait_healthy 60 $started
echo "running api replicas: $(service_ids api | wc -l | tr -d ' ')"