Last active
September 5, 2018 21:08
-
-
Save fkbenjamin/79f8e15a3183f4bf8aa8437d05057cfa to your computer and use it in GitHub Desktop.
Alerts via SMS if a new proposal on the Cosmos Testnet is found.
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 | |
phone=$1 | |
last_proposal=$(gaiacli gov query-proposals | tail -1) | |
echo "Queried last proposal" | |
echo $last_proposal | |
while true | |
do | |
sleep 10s | |
new_last_proposal=$(gaiacli gov query-proposals | tail -1) | |
if [ "$last_proposal" != "$new_last_proposal" ] | |
then | |
echo "New Proposal found" | |
echo "Send SMS to $phone" | |
curl -s -d "to=%2B$phone" -d "body=Found a new proposal! $new_last_proposal" https://utils.lib.id/sms@1.0.4/ | |
last_proposal=$new_last_proposal | |
echo "" | |
else | |
echo "No new Proposal $new_last_proposal" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@BaryonNetwork You can find more info in the SMS lib at https://stdlib.com/@utils/lib/sms/