Skip to content

Instantly share code, notes, and snippets.

@fkbenjamin
Last active September 5, 2018 21:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fkbenjamin/79f8e15a3183f4bf8aa8437d05057cfa to your computer and use it in GitHub Desktop.
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.
#!/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
@fkbenjamin
Copy link
Author

@BaryonNetwork You can find more info in the SMS lib at https://stdlib.com/@utils/lib/sms/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment