Skip to content

Commit

Permalink
Create stop.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Kwonminwoo authored Dec 15, 2023
1 parent 345406c commit f70bd2b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions stop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

PROJECT_ROOT="/home/ubuntu/app"
JAR_FILE="$PROJECT_ROOT/aroom_be.jar"

DEPLOY_LOG="$PROJECT_ROOT/deploy.log"

TIME_NOW=$(date +%c)

# 현재 구동 중인 애플리케이션 pid 확인
CURRENT_PID=$(pgrep -f $JAR_FILE)

# 프로세스가 켜져 있으면 종료
if [ -z $CURRENT_PID ]; then
echo "$TIME_NOW > 현재 실행중인 애플리케이션이 없습니다" >> $DEPLOY_LOG
else
echo "$TIME_NOW > 실행중인 $CURRENT_PID 애플리케이션 종료 " >> $DEPLOY_LOG
kill -9 $CURRENT_PID
fi

0 comments on commit f70bd2b

Please sign in to comment.