#!/bin/bash

 

while :

do

 date=`date`

 res_code=`curl --connect-timeout 1 -m 1 -# -o /dev/null -I -w %{http_code} -s -XGET http://IP주소`

 if [ $res_code = 200 ]; then

         echo $date : $res_code

 else

         echo "Error!!! Error!"

         echo $date : $res_code

         echo "Error!!! Error!"

 fi

 

done

 

 

& : 응답을 기다리지 않고 강제 실행

> /dev/null  : 출력없이 실행

curl -k https://URL : 인증서 오류 무시하고 Request 진행