This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Make API request and extract the IP addresses from the "hoprd_api_endpoint" field | |
| ips=( $(curl --silent --request GET --url https://staging.discovery.rpch.tech/api/v1/node?status=READY | jq -r '.[].hoprd_api_endpoint | sub("http://"; "") | sub(":[0-9]*$"; "")') ) | |
| # Path to SSH private key for authentication | |
| private_key_path=".ssh/id_rsa" | |
| # Loop through the remote hosts and run the script on each one | |
| for ip in "${ips[@]}" |