Last active
January 3, 2022 02:45
-
-
Save josinaldobarbosa/bbe1437d1a9a273f13eda83c429c139d to your computer and use it in GitHub Desktop.
Add chia connections from chia.keva.app
This file contains 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 | |
### CONFIG ### | |
APP_LOCATION="/usr/lib/chia-blockchain/resources/app.asar.unpacked/daemon/chia" | |
############## | |
HTML=$(curl -sS https://chia.keva.app/) | |
ipRegex="[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" | |
IPS=($(echo ${HTML} | grep -Eo "${ipRegex}")) | |
echo "Total IPs found: ${#IPS[@]}" | |
for ip in "${IPS[@]}" | |
do | |
${APP_LOCATION} show --add-connection "${ip}:8444" | |
done | |
connections=($(${APP_LOCATION} show --connections | grep FULL_NODE | awk '{print $2}')) | |
echo "Total connections: ${#connections[@]}" |
to run at an interval of 1 hour: watch -n 3600 ./chia-add-connections.sh
Awesome, thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
APP_LOCATION change to you bin location, ex. env location = chia, the default is from experimental GUI