#!/bin/sh
URL=$1
result=`curl -o /dev/null -s -m 10 --connect-timeout 10 -w %{http_code} $URL`
test=`echo $result`
if [[ "$test" = "200" ]];then
echo 'cdn sync ok'
else
while [ "$test" != "200" ];do
result=`curl -o /dev/null -s -m 10 --connect-timeout 10 -w %{http_code} $URL`
test=`echo $result`
if [[ "$test" != "200" ]];then
sleep 2
continue
else
echo 'cdn sync ok!'
fi
done
fi