Guest User

Checking server status 200

a guest
Dec 29th, 2016
67
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data