#!/usr/bin/env bash
set -Eeuo pipefail

NODES=(
  #remn-fin
  #remn-sweden
  #remn-nl-02
  remn-msk
  remn-riga
  remn-nl-01
#  remn-paris
  
   )

REMOTE_DIR="/opt/remnanode"

for node in "${NODES[@]}"; do
  echo "=== Updating ${node} ==="

  if ssh "$node" "cd ${REMOTE_DIR} && docker compose pull && docker compose up -d"; then
    echo "=== ${node}: OK ==="
  else
    echo "=== ${node}: FAILED ==="
  fi

  echo
done

