Linux script with curl to check webservice is up

curl -sL -w "%{http_code}\\n" "http://www.google.com/" -o /dev/null
  • -s = Silent cURL’s output
  • -L = Follow redirects
  • -w = Custom output format
  • -o = Redirects the HTML output to /dev/null

Example:

[~]$ curl -sL -w "%{http_code}\\n" "http://www.google.com/" -o /dev/null
200

I would probably remove the \\n if I were to capture the output.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)