forked from WeBankBlockchain/WeBASE-Evidence-Sample
-
Notifications
You must be signed in to change notification settings - Fork 0
/
stop.sh
37 lines (34 loc) · 1.08 KB
/
stop.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
APP_MAIN=com.webank.webase.evidence.sample.Application
tradePortalPID=0
getTradeProtalPID(){
javaps=`$JAVA_HOME/bin/jps -l | grep $APP_MAIN`
if [ -n "$javaps" ]; then
tradePortalPID=`echo $javaps | awk '{print $1}'`
else
tradePortalPID=0
fi
}
stop(){
getTradeProtalPID
echo "==============================================================================================="
if [ $tradePortalPID -ne 0 ]; then
echo -n "Stopping $APP_MAIN (PID=$tradePortalPID)..."
kill -9 $tradePortalPID
if [ $? -eq 0 ]; then
echo "[Success]"
echo "==============================================================================================="
else
echo "[Failed]"
echo "==============================================================================================="
fi
getTradeProtalPID
if [ $tradePortalPID -ne 0 ]; then
stop
fi
else
echo "$APP_MAIN is not running"
echo "==============================================================================================="
fi
}
stop