Skip to content

Commit

Permalink
update check_all.sh (#374)
Browse files Browse the repository at this point in the history
* update component check

* update component check

* update check_all.sh
  • Loading branch information
AndrewZuo01 authored Jan 10, 2024
1 parent 9bc8638 commit 4c3e9b8
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions scripts/check_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,23 @@ for i in "${service_port_name[@]}"; do
;;
esac

port=$(ss -tunlp | grep "$new_service_name" | awk '{print $5}' | awk -F '[:]' '{print $NF}')
if [[ "$port" != "$new_service_port" ]]; then
echo -e "${YELLOW_PREFIX}${i}${COLOR_SUFFIX}${RED_PREFIX} service does not start normally, not initiated port is ${COLOR_SUFFIX}${YELLOW_PREFIX}${new_service_port}${COLOR_SUFFIX}"
echo -e "${RED_PREFIX}please check ${SCRIPTS_ROOT}/../logs/openIM.log ${COLOR_SUFFIX}"
exit -1
else

ports=$(ss -tunlp | grep "$new_service_name" | awk '{print $5}' | awk -F '[:]' '{print $NF}')

found_port=false
for port in $ports; do
if [[ "$port" == "$new_service_port" ]]; then
echo -e "${new_service_port}${GREEN_PREFIX} port has been listening, belongs service is ${i}${COLOR_SUFFIX}"
found_port=true
break
fi
done

if [[ "$found_port" != true ]]; then
echo -e "${YELLOW_PREFIX}${i}${COLOR_SUFFIX}${RED_PREFIX} service does not start normally, expected port is ${COLOR_SUFFIX}${YELLOW_PREFIX}${new_service_port}${COLOR_SUFFIX}"
echo -e "${RED_PREFIX}please check ${SCRIPTS_ROOT}/../logs/openIM.log ${COLOR_SUFFIX}"
exit -1
fi

done

0 comments on commit 4c3e9b8

Please sign in to comment.