Linux ShellScript 서버 Health Check 만들기
#!/bin/bash URLS=("URL1" URL2" ) DATE=$(date '+%Y-%m-%d %H:%M:%S') for i in "${URLS[@]}"; do contentLength=$(curl -isSf $i | grep 'Content-Length' | awk '{print $2}') echo "NOW: " $DATE ", Find : $contentLength" contentLength="${contentLength//[$'\t\r\n ']}" if [[ "$contentLength" -eq 0 ]]; then echo $i' is Empty.' else echo $i' is not Empty.' fi done bash 쉘로 스크립트를 구성하였다. URLS=("URL1" URL2" ) he..