Skip to content

Instantly share code, notes, and snippets.

@bradneuman
Created July 3, 2022 01:42
Show Gist options
  • Save bradneuman/548cc0d3dde92b6c90461d777bef2583 to your computer and use it in GitHub Desktop.
Save bradneuman/548cc0d3dde92b6c90461d777bef2583 to your computer and use it in GitHub Desktop.
refund notifier for rocketpool using pushover
MESSAGE_TITLE="Rocketpool Refund Available!"
source ./keys.sh
REFUND=`rocketpool minipool status | grep -A 1 "refund"`
RESULT=$?
if [[ "$1" = "--test" && $RESULT -ne 0 ]];
then
RESULT=0
REFUND="just testing at `date`"
fi
if [ $RESULT -ne 0 ];
then
echo "no refund available"
exit $RESULT
else
echo $RESULT
echo "sending notification"
curl -f -X POST -d "token=$PUSHOVER_TOKEN&user=$PUSHOVER_USER&title=$MESSAGE_TITLE&message=$REFUND&url=&priority=0" https://api.pushover.net/1/messages.json
exit $RESULT
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment