I am looking for a simple shell (+curl) check that would evaluate as true or false if an URL exists (returns 200) or not.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Using
--failwill make the exit status nonzero on a failed request. Using--headwill avoid downloading the file contents, since we don’t need it for this check. Using--silentwill avoid status or errors from being emitted by the check itself.If your server refuses HEAD requests, an alternative is to request only the first byte of the file: