#!/bin/sh
#2017. 04. 06 Created by BUSARI
echo “shutting down…..”
pid=`ps -ef | grep 대상프로세스명 | grep -v ‘grep’ | awk ‘{print $2}’`
if [ -z $pid ]; then
echo “Stopped.”
exit 1
else
kill -9 $pid
fi
sleep 1
PROCESS_COUNT=`ps -ef | grep 대상프로세스명 | grep -v ‘grep’ | awk ‘{print $2}’ | wc | awk ‘{print $1}’`
if [ “$PROCESS_COUNT” = “0” ]; then
echo “Process Stopped.”
else
echo “Process down fail.”
fi
댓글