#!/bin/bash
export LANG=ko_KR.UTF-8
echo "Shutdown tomcat now...."
bash /WAS/apache-tomcat-9.0.19/bin/shutdown.sh
echo "tomcat is now terminated..."
sleep 10
if [ -z "`ps -eaf | grep java | grep /WAS/apache-tomcat-9.0.19/bin`" ]; then
echo "Tomcat was terminated successfully."
else
ps -eaf | grep java | grep /WAS/apache-tomcat-9.0.19/bin | awk '{print $2}' |
while read PID
do
echo "Killing $PID... "
kill -9 $PID
echo "Tomcat is being shutdowned"
done
fi
echo "tomcat restart now"
bash /WAS/apache-tomcat-9.0.19/bin/startup.sh
if [ -z "`ps -eaf | grep java | grep /WAS/apache-tomcat-9.0.19/bin`" ]; then
echo "Error!!! Cannot start tomcat server."
else
echo "Tomcat restart succcessfully. "
fi
echo "Job finished"
'Server' 카테고리의 다른 글
linux 명령어 간단 정리 2 (0) | 2021.01.10 |
---|---|
linux 명령어 간단 정리 1 (0) | 2021.01.09 |
[Linux/Centos] 타임존 변경 및 시간 설정 (0) | 2016.11.10 |
[Linux/Centos] 버전 확인 및 비트 확인 (0) | 2016.11.10 |
[Linux/Centos] 용량 확인 (0) | 2016.11.10 |