-
Notifications
You must be signed in to change notification settings - Fork 19
/
start.sh
47 lines (39 loc) · 1.17 KB
/
start.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
41
42
43
44
45
46
47
#!/bin/sh
if [ ! -f "conf/config.xml" ];then
echo "not found conf/config.xml file"
exit
fi
routeAddress=`grep '${routeAddress}' conf/config.xml`
if [ ${routeAddress}"" != "" ];then
#发布路由合约
if [ ! -f "conf/route.json" ];then
echo "not found conf/route.json file"
exit
fi
javaPath=`which java`
if [ ${javaPath}"" = "" ];then
echo "java not found in PATH"
exit
fi
java -cp conf/:apps/*:lib/* org.bcos.proxy.tool.DeployContract deploy conf/route.json > .route.address
address=`awk -F':' '{print $2}' .route.address`
if [ ${address}"" = "" ];then
rm .route.address
echo "deploy route contract failed."
exit
fi
rm .route.address
sed -i 's/${routeAddress}/'${address}'/g' conf/config.xml
fi
existed=`netstat -npl | grep 8081 | grep java | wc -l`
if [ ${existed}"" = "0" ];then
javaPath=`which java`
if [ ${javaPath}"" = "" ];then
echo "java not found in PATH"
exit
fi
setsid java -cp conf/:apps/*:lib/* -Dserver=http -Dport=8081 org.bcos.proxy.main.Start >> /dev/null 2>&1 &
echo "start success"
else
echo "java process is running..."
fi