tempcheck.sh 357 B

123456789101112131415161718
  1. #!/bin/bash
  2. #
  3. # GPLv3 see COPYING.GPL
  4. while sleep 1800; do
  5. # you need to change this to your location
  6. TEMP=`curl -s https://meteo.gc.ca/forecast/hourly/sk-40_metric_f.html | grep header2 | awk -F'>' '{print $2}' | awk -F'<' '{print $1}' | head -n 2 | tail -n 1`
  7. if (( $TEMP > 23 )); then
  8. echo HOT;
  9. notify-send -u normal "HOT";
  10. else
  11. echo ok;
  12. fi;
  13. done;