mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-11-05 11:52:10 +08:00
Optimizing scripts
This commit is contained in:
parent
e7da8d31fe
commit
9a42d72239
@ -2867,6 +2867,21 @@ function openim::util::find_process_ports() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function openim::util::find_process_ports3(){
|
||||||
|
local protocol_ports=""
|
||||||
|
while read -r line; do
|
||||||
|
local port_protocol=($line)
|
||||||
|
local port=${port_protocol[0]##*:}
|
||||||
|
local protocol=${port_protocol[1]}
|
||||||
|
protocol_ports="${protocol_ports}${protocol} ${port}, "
|
||||||
|
echo "Process $process_path is listening on port $port with protocol $protocol"
|
||||||
|
done < <(lsof -nP -iTCP -iUDP | grep LISTEN | grep "$(pgrep -f "$process_path")" | awk '{print $9, $8}')
|
||||||
|
|
||||||
|
protocol_ports=${protocol_ports%, }
|
||||||
|
echo "Process $process_path is listening on protocol & port $protocol_ports "
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
function openim::util::find_process_ports2() {
|
function openim::util::find_process_ports2() {
|
||||||
local process_path="$1"
|
local process_path="$1"
|
||||||
if [[ -z "$process_path" ]]; then
|
if [[ -z "$process_path" ]]; then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user