bug fix and shell optimization

This commit is contained in:
Gordon
2021-09-13 15:48:19 +08:00
parent c1bcadd9ed
commit 649bc5657e
14 changed files with 72 additions and 42 deletions
+4 -1
View File
@@ -4,6 +4,8 @@ source ./style_info.cfg
source ./path_info.cfg
source ./function.sh
list1=$(cat $config_path | grep openImPushPort | awk -F '[:]' '{print $NF}')
list_to_string $list1
rpc_ports=($ports_array)
@@ -23,11 +25,12 @@ for ((i = 0; i < ${#rpc_ports[@]}; i++)); do
nohup ./${push_name} -port ${rpc_ports[$i]} >>../logs/${push_name}.log 2>&1 &
done
sleep 1
#Check launched service process
check=$(ps aux | grep -w ./${push_name} | grep -v grep | wc -l)
if [ $check -eq 1 ]; then
newPid=$(ps aux | grep -w ./${push_name} | grep -v grep | awk '{print $2}')
ports=$(netstat -netulp | grep ${newPid} | awk '{print $4}' | awk -F '[:]' '{print $NF}')
ports=$(netstat -netulp | grep -w ${newPid} | awk '{print $4}' | awk -F '[:]' '{print $NF}')
allPorts=""
for i in $ports; do