When I execute this script on the server, I get the response code as 000, but I get the status code 200 when I execute it on the local machine. This happens for one URL and 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 on some forums that the problem is with SSL. Please let me know what can be changed in Script.
source
share