wttr 549 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/sh
  2. if [ "$1" = "help" ]; then
  3. echo "*** Description ***"
  4. echo "Prints weather forcast from wttr.in; defaults to O'Fallon, MO"
  5. echo ""
  6. echo "*** Usage ***"
  7. echo "wttr [full]"
  8. echo ""
  9. echo "*** Parameters ***"
  10. echo ""
  11. echo "*** Options ***"
  12. echo "full: Outputs full forcast from wttr.in"
  13. echo ""
  14. exit 0
  15. fi
  16. wget -q --spider http://gnu.org
  17. if [ $? = 0 ]; then
  18. if [ "$1" = "full" ]; then
  19. curl -s wttr.in/OFallon
  20. else
  21. curl -s "wttr.in/OFallon?0"
  22. fi
  23. else
  24. exit 1
  25. fi