mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-11-10 00:22:23 +08:00
Optimizing scripts
This commit is contained in:
parent
b756959139
commit
c4e8b796ac
@ -2854,13 +2854,22 @@ function openim::util::find_process_ports() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
local ports_info=""
|
||||||
|
|
||||||
lsof -nP -iTCP -iUDP | grep LISTEN | grep "$(pgrep -f $process_path)" | awk '{print $9, $8}' | while read line; do
|
lsof -nP -iTCP -iUDP | grep LISTEN | grep "$(pgrep -f $process_path)" | awk '{print $9, $8}' | while read line; do
|
||||||
local port_protocol=($line)
|
local port_protocol=($line)
|
||||||
local port=${port_protocol[0]##*:}
|
local port=${port_protocol[0]##*:}
|
||||||
local protocol=${port_protocol[1]}
|
local protocol=${port_protocol[1]}
|
||||||
echo "Process $process_path is listening on port $port with protocol $protocol"
|
ports_info+="$port($protocol) "
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
|
if [[ -z "$ports_info" ]]; then
|
||||||
|
echo "No ports found for process $process_path."
|
||||||
|
else
|
||||||
|
|
||||||
|
echo "Process $process_path is listening on ports: $ports_info"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function openim::util::find_ports_for_all_services() {
|
function openim::util::find_ports_for_all_services() {
|
||||||
|
|||||||
@ -120,11 +120,11 @@ if [[ $? -ne 0 ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
openim::util::find_ports_for_all_services ${OPENIM_ALL_SERVICE_LIBRARIES_NO_TRANSFER[@]}
|
|
||||||
|
|
||||||
|
|
||||||
openim::log::status "Start the post-start tools:"
|
openim::log::status "Start the post-start tools:"
|
||||||
${TOOLS_START_SCRIPTS_PATH} openim::tools::post-start
|
${TOOLS_START_SCRIPTS_PATH} openim::tools::post-start
|
||||||
openim::log::status "post-start has been successfully completed!"
|
openim::log::status "post-start has been successfully completed!"
|
||||||
|
openim::util::find_ports_for_all_services ${OPENIM_ALL_SERVICE_LIBRARIES_NO_TRANSFER[@]}
|
||||||
openim::log::success "All OpenIM services have been successfully started!"
|
openim::log::success "All OpenIM services have been successfully started!"
|
||||||
Loading…
x
Reference in New Issue
Block a user