Created
February 20, 2019 15:39
-
-
Save lesstif/b9688787763010dd1f8b6085e6d5b518 to your computer and use it in GitHub Desktop.
cur l로 HTTP 서버 상태 체크
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$#" -lt 1 ]; then | |
echo "$# is Illegal number of parameters." | |
echo "Usage: $0 http://example.org" | |
exit 1 | |
fi | |
SERVER=$1 | |
RESPONSE=$(curl -L -s -o /dev/null -w "%{http_code}" ${SERVER}) | |
if [ ${RESPONSE} -ne 200 ];then | |
echo "${SERVER} returned bad status: ${RESPONSE}" | |
exit ${RESPONSE} | |
fi; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment