storj/scripts/fix-mock-overlay

13 lines
362 B
Plaintext
Raw Normal View History

#!/bin/bash
set -euo pipefail
ids="$(
for cid in $(docker ps -a | awk '/storagenode/{print $1}'); do
ip="$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $cid)"
id="$(docker logs $cid 2>&1 | awk '/started/{print $5; exit}')"
echo $id:$ip:7777
done | tr '\n' ','
)"
sed -i'' -e "s/nodes .*$/nodes ${ids%,}/" docker-compose.yaml