Advertisement
Guest User

Untitled

a guest
Apr 20th, 2018
436
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #!/bin/bash
  2. subject="Server Status Alert"
  3. from="youremail@gmail.com"
  4. to="youremail@gmail.com"
  5. # confirm the website/server is runing
  6. https=https://yourdomain.duckdns.org
  7. status=`curl $https -k -s -f -o /dev/null && echo "SUCCESS" || echo "ERROR"`
  8. if [[ "$status" == ERROR ]]; then
  9. echo Notice | mail -s "Home Assistant Down" youremail@gmail.com
  10. fi
  11. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement