tempcheck.sh 287 B

123456789101112131415
  1. #!/bin/bash
  2. while sleep 1800; do
  3. 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`
  4. if (( $TEMP > 23 )); then
  5. echo HOT;
  6. notify-send -u normal "HOT";
  7. else
  8. echo ok;
  9. fi;
  10. done;