From 9d6f523ac18f8360ef7d12feae2ddb1097b7adf0 Mon Sep 17 00:00:00 2001 From: ryulkim <58160874+ryulkim@users.noreply.github.com> Date: Tue, 14 Nov 2023 23:48:21 +0900 Subject: [PATCH] Update stop.sh --- scripts/stop.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/stop.sh b/scripts/stop.sh index 0199ac7..70ae64d 100644 --- a/scripts/stop.sh +++ b/scripts/stop.sh @@ -1,14 +1,17 @@ #!/usr/bin/env bash PROJECT_ROOT="/var/www/deploy" -JAR_FILE="$PROJECT_ROOT/ryulSpring.jar" DEPLOY_LOG="$PROJECT_ROOT/deploy.log" TIME_NOW=$(date +%c) +# jar 찾기 +JAR_FILE=$(ls -tr $PROJECT_ROOT/ | grep jar | tail -n 1) +echo "JAR Name: $JAR_FILE" >> $DEPLOY_LOG + # 현재 구동 중인 애플리케이션 pid 확인 -CURRENT_PID=$(pgrep -f $JAR_FILE) +CURRENT_PID=$(pgrep -f $PROJECT_ROOT/$JAR_FILE) # 프로세스가 켜져 있으면 종료 if [ -z $CURRENT_PID ]; then