From 4ea1c75ac12d6f93f99a716a4b7451e115b54650 Mon Sep 17 00:00:00 2001 From: away <1819625428@qq.com> Date: Tue, 14 Sep 2021 11:39:06 +0800 Subject: [PATCH] update --- script/check_all.sh | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/script/check_all.sh b/script/check_all.sh index 05873dcd5..9d7c7d030 100644 --- a/script/check_all.sh +++ b/script/check_all.sh @@ -16,17 +16,18 @@ service_port_name=( openImPushPort websocketPort ) - for i in ${service_port_name[@]};do - list=$(cat $config_path | grep -w ${i} | awk -F '[:]' '{print $NF}') - list_to_string $list - for j in ${ports_array};do - port=`netstat -netulp |grep ./open_im| awk '{print $4}'|grep -w ${j}|awk -F '[:]' '{print $NF}'` - if [[ ${port} -ne ${j} ]]; then - echo -e ${YELLOW_PREFIX}${i}${COLOR_SUFFIX}${RED_PREFIX}" service does not start normally,not initiated port is "${COLOR_SUFFIX}${YELLOW_PREFIX}${j}${COLOR_SUFFIX} - exit 1 - else - echo -e ${j}${GREEN_PREFIX}" port has been listening,belongs service is "${i}${COLOR_SUFFIX} - fi - done +for i in ${service_port_name[*]}; do + list=$(cat $config_path | grep -w ${i} | awk -F '[:]' '{print $NF}') + list_to_string $list + for j in ${ports_array}; do + port=$(netstat -netulp | grep ./open_im | awk '{print $4}' | grep -w ${j} | awk -F '[:]' '{print $NF}') + if [[ ${port} -ne ${j} ]]; then + echo -e ${YELLOW_PREFIX}${i}${COLOR_SUFFIX}${RED_PREFIX}" service does not start normally,not initiated port is "${COLOR_SUFFIX}${YELLOW_PREFIX}${j}${COLOR_SUFFIX} + exit 1 + else + echo -e ${j}${GREEN_PREFIX}" port has been listening,belongs service is "${i}${COLOR_SUFFIX} + fi done - echo -e ${YELLOW_PREFIX}"all service launch success"${COLOR_SUFFIX} +done + +echo -e ${YELLOW_PREFIX}"all service launch success"${COLOR_SUFFIX}