Skip to content

Instantly share code, notes, and snippets.

@lesstif
Created February 20, 2019 15:39
Show Gist options
  • Save lesstif/b9688787763010dd1f8b6085e6d5b518 to your computer and use it in GitHub Desktop.
Save lesstif/b9688787763010dd1f8b6085e6d5b518 to your computer and use it in GitHub Desktop.
cur l로 HTTP 서버 상태 체크
#!/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