How can I return 0 when the response status is 200?
Right now I'm able to get the status, e.g. 200 with the following command:
curl -LI http://google.com -o /dev/null -w '%{http_code}\n' -s
But what I need to do is turn this 200 in a return 0.
How can I achieve this?
I tried the following command but it doesn't return:
if [$(curl -LI http://google.com -o /dev/null -w '%{http_code}\n' -s) == "200"]; then echo 0