Optimizing scripts

pull/2100/head
skiffer-git 2 years ago
parent 3b412a5708
commit 2e7adecff3

@ -2865,8 +2865,12 @@ function openim::util::find_process_ports() {
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 "
if [[ -z "$protocol_ports" ]]; then
echo "Process $process_path is not listening on any ports"
else
echo "Process $process_path is listening on protocol & port: $protocol_ports"
fi
}

Loading…
Cancel
Save