Skip to content
This repository has been archived by the owner on Dec 2, 2023. It is now read-only.

Commit

Permalink
(fix): fix script stop find process id (#535)
Browse files Browse the repository at this point in the history
  • Loading branch information
adwpc committed Apr 11, 2021
1 parent 9d67268 commit e3047f7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/service
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ function stop(){
echo "stop $SERVICE..."
PID=`cat $PID_FILE`
if [ ! -n "$PID" ]; then
echo "pid not exist"
exit 1;
PID=`ps -ef | grep "$1" | grep -v "grep" | grep -v "service" | awk '{print $2}'`
if [ ! -n "$PID" ]; then
exit 1
fi
fi
SUB_PIDS=`pgrep -P $PID`
if [ -n "$SUB_PIDS" ]; then
Expand Down

0 comments on commit e3047f7

Please sign in to comment.