-
Notifications
You must be signed in to change notification settings - Fork 2
/
service_restart
31 lines (28 loc) · 1.06 KB
/
service_restart
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
#!/bin/sh
# 重启 apiService
apiService=$(ps -ef|grep "/apiService" | grep -v "grep" | awk '{print $2}')
if [ "$apiService" ]
then
kill -9 "$apiService"
nohup ./apiService > logs/apiService.log 2>&1 & echo $!>logs/apiService.pid
else
nohup ./apiService > logs/apiService.log 2>&1 & echo $!>logs/apiService.pid
fi
# 重启 huobiService
huobiService=$(ps -ef|grep "/huobiService" | grep -v "grep" | awk '{print $2}')
if [ "$huobiService" ]
then
kill -9 "$huobiService"
nohup ./huobiService > logs/huobiService.log 2>&1 & echo $!>logs/huobiService.pid
else
nohup ./huobiService > logs/huobiService.log 2>&1 & echo $!>logs/huobiService.pid
fi
# 重启 optionContractService
optionContractService=$(ps -ef|grep "/optionContractService" | grep -v "grep" | awk '{print $2}')
if [ "$optionContractService" ]
then
kill -9 "$optionContractService"
nohup ./optionContractService > logs/optionContractService.log 2>&1 & echo $!>logs/optionContractService.pid
else
nohup ./optionContractService > logs/optionContractService.log 2>&1 & echo $!>logs/optionContractService.pid
fi