Skip to content

Instantly share code, notes, and snippets.

@pasora
Created October 26, 2016 08:49
Show Gist options
  • Save pasora/8cdbf0f956dc82f8c4d1f0f1f46566c7 to your computer and use it in GitHub Desktop.
Save pasora/8cdbf0f956dc82f8c4d1f0f1f46566c7 to your computer and use it in GitHub Desktop.
Warning High CPU Temperature from Raspberry Pi to LINE Notify
#!/bin/sh
# degined for Raspberry Pi 3
# before running, you have to install bc by `sudo apt-get install bc`
temp=`vcgencmd measure_temp | sed -e 's/temp\=//' -e "s/'C//"`
if [ "$(echo "$temp > 40.0" | bc)" -eq 1 ]; then
curl -X POST -H 'Authorization: Bearer [your_access_token]' -F "message=現在${temp}度です" https://notify-api.line.me/api/notify > /dev/null 2>&1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment