Advertisement
Guest User

Checking server status 200

a guest
Dec 29th, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. URL="www.noexisteestadsadsadasd.com"
  2. antes="UP"
  3. if curl -s --head $URL | grep "200 OK" > /dev/null
  4. then
  5. http="UP"
  6. else
  7. http="DOWN"
  8. fi
  9. if [ "$http" != "$antes" ]
  10. then
  11. echo "server changed state"
  12. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement