-
Notifications
You must be signed in to change notification settings - Fork 25
/
command.sh
executable file
·41 lines (34 loc) · 1.05 KB
/
command.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
38
39
40
#!/bin/bash -x
daemon_pid=
JAVA_OPTS='-Djdk.tls.namedGroups="secp256r1,secp256k1"'
if [[ "$1" != "issuer" ]];then
if [[ "$1" != "user_agent" ]];then
if [[ "$1" != "verifier" ]];then
if [[ "$1" != "daemon" ]];then
echo "please input the correct parameters:issuer, user_agent, verifier, daemon"
exit 1
fi
fi
fi
fi
getDaemonPid(){
daemon_pid=`ps aux|grep "DemoCommand" | grep "daemon" | grep -v grep|awk '{print $2}'|head -1`
}
if [[ "$1" == daemon ]];then
getDaemonPid
if [ -n "$daemon_pid" ];then
echo "the AMOP server already start."
exit 1
fi
java ${JAVA_OPTS} -cp dist/app/*:resources/:dist/lib/* com.webank.weid.demo.command.DemoCommand $1 >/dev/null 2>&1 &
sleep 2
getDaemonPid
if [ -n "$daemon_pid" ];then
echo "the AMOP server start success."
else
echo "the AMOP server start fail."
fi
else
echo "--------- start $1 ----------"
java ${JAVA_OPTS} -cp dist/app/*:resources/:dist/lib/* com.webank.weid.demo.command.DemoCommand $1
fi