Commit ccb96535 authored by neil's avatar neil
Browse files

compatible for windows netstat tool

parent d3d884c1
......@@ -183,7 +183,12 @@ _ss() {
_port="$1"
if command -v "netstat" >/dev/null 2>&1 ; then
_debug "Using: netstat"
netstat -ntpl | grep :$_port" "
if netstat -h 2>&1 | grep "\-p proto" >/dev/null ; then
#for windows version netstat tool
netstat -nb -p tcp | grep :$_port" "
else
netstat -ntpl | grep :$_port" "
fi
return 0
fi
if command -v "ss" >/dev/null 2>&1 ; then
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment