Optimize script logs

pull/2007/head
skiffer-git 2 years ago
parent 2b4063a9f7
commit bb8eb2d5ac

@ -388,16 +388,17 @@ openim::util::check_process_names() {
local pid=$1
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
# Linux
ss -ltnp 2>/dev/null | grep $pid | awk '{print $4}' | cut -d ':' -f2
ss -ltnp 2>/dev/null | grep $pid | awk '{print $4}' | cut -d ':' -f2 | tr '\n' ' '
elif [[ "$OSTYPE" == "darwin"* ]]; then
# macOS
lsof -nP -iTCP -sTCP:LISTEN -a -p $pid | awk 'NR>1 {print $9}' | sed 's/.*://'
lsof -nP -iTCP -sTCP:LISTEN -a -p $pid | awk 'NR>1 {print $9}' | sed 's/.*://' | tr '\n' ' '
else
echo "Unsupported OS"
return 1
fi
}
# Arrays to collect details of processes
local not_started=()
local started=()

Loading…
Cancel
Save