get_pid_list=$(ps -eaf | grep es.ini | grep -v grep | awk '{print $ 2}')
filter_pid='' read -ra pids<<<"$get_pid_list"
ps=${pids[0]}
echo "PID is "${ps}
status_result=$(curl -L -k -s -o /dev/null -w "%{http_code}\n" 서비스호출주소http://localhost웅앵)
echo "curl result is "${status_result}
#만약 pid가 없으면서 status result가 502라면
if [ -n {ps} -a ${status_result} -eq 502 ];then
echo "메세지"
kill -9 ${ps}
해야할일 랄랄랄
elif [ ${status_result} -eq 502 ];then
echo "메세지"
해야할일 >_<
else
echo "ALL STATUS NORMAL"
fi
'Linux-공통 > Linux-공통__shell-script' 카테고리의 다른 글
내가 배포하면 잘되는데 스크립트가 배포하면 잘 안될 때 (0) | 2020.10.12 |
---|---|
crontab 크론탭 10초에 한번씩 실행하기 (0) | 2019.10.04 |
crontab (0) | 2019.09.20 |
curl post xml indent (0) | 2019.09.20 |
오류시 실행 중단 (0) | 2019.07.09 |