Skip to content

Instantly share code, notes, and snippets.

View diegoalzate's full-sized avatar
🧱
building

Diego Alzate diegoalzate

🧱
building
View GitHub Profile
@diegoalzate
diegoalzate / restart.sh
Last active April 28, 2023 06:55
restart hoprd nodes on rpch
#!/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[@]}"