#!/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 $4; exit}')" echo $id:$ip:7777 done | tr '\n' ',' )" sed -i'' -e "s/NODES=.*$/NODES=${ids%,}/" docker-compose.yaml