Created
March 26, 2018 15:36
-
-
Save Breakerz/0a8bbcec890aee6d5ec2262b8934f47e to your computer and use it in GitHub Desktop.
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 | |
tmpfile="/tmp/$(cat /dev/urandom | tr -cd 'a-f0-9' | head -c 32)" | |
if curl -s 'http://api.thingspeak.com/channels/1417/field/2/last.json' > $tmpfile | |
then | |
cat $tmpfile| jq -r '.field2'| mosquitto_pub -h 192.168.0.123 -i clientmood -l -t "moodlight/mood" | |
fi | |
rm $tmpfile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment