#!/bin/bash set -euo pipefail ids="$( for cid in $(docker ps | awk '/storage-node/{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