When i am executing this script on server i am getting response code as 000 but i am getting status code as 200 when i am executing this on local machine. This is happening for the same URL & Script.
flag=0
for URL in $@
do
STATUS=$(curl -s -o /dev/null -w '%{http_code}' $URL)
if ([ $STATUS -gt 400 ] || [ $STATUS -lt 100 ]); then
echo $URL "is not working fine, STATUS CODE is "$STATUS
flag=1
else
echo $URL "is working, STATUS CODE is "$STATUS
fi
done
if [ $flag -eq 1 ]; then
exit 1
fi
I have seen in some forums that the problem is due to SSL. Please let me know what can be changed in above script.
also use -k
or the --insecure
parameter with your curl commandline to overcome this issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With