Last active
June 21, 2018 01:45
-
-
Save xaviablaza/b47d27f4bfdef9d280601e7d934f3615 to your computer and use it in GitHub Desktop.
Checks the status of stellar-core
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 | |
| # sudo apt install jq | |
| # $1 should be core ip | |
| # $2 should be core port | |
| CORE_STATE=$(curl -s "$1/info" | jq -r '.info.state') | |
| SYNCED_STATE="Synced!" | |
| # if not "Synced!" send "boo" | |
| if [ "$CORE_STATE" != "$SYNCED_STATE" ]; then | |
| echo "boo" | |
| # otherise print 0 | |
| else | |
| echo 0 | |
| fi |
Author
Cool. I think passing the whole domain & port as one will simplify it: ./core-checker.sh http://core.com:1234
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sh core-checker.sh localhost 11626