Instantly share code, notes, and snippets.

Embed
What would you like to do?
Script for monitoring reward call and sending SMS
#!/bin/bash
journalctl -u livepeer-transcoder.service -f | \
while read line ; do
echo "$line" | grep "Called reward for round"
if [ $? = 0 ]
then
curl -s -d "to=%2Byour_number" -d "body=Completed Reward Call!" https://utils.lib.id/sms@1.0.4/
fi
echo "$line" | grep "Invoking transaction: \"reward\""
if [ $? = 0 ]
then
curl -s -d "to=%2Byour_number" -d "body=Started Reward Call!" https://utils.lib.id/sms@1.0.4/
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment