mirror of
https://github.com/plantroon/acme.sh.git
synced 2024-12-22 21:21:42 +00:00
compatible for netstat on FreeBSD
This commit is contained in:
parent
50a4ef9cca
commit
edf08da6f3
19
le.sh
19
le.sh
@ -181,21 +181,28 @@ _sign() {
|
|||||||
|
|
||||||
_ss() {
|
_ss() {
|
||||||
_port="$1"
|
_port="$1"
|
||||||
if command -v "netstat" >/dev/null 2>&1 ; then
|
|
||||||
|
if _exists "ss" ; then
|
||||||
|
_debug "Using: ss"
|
||||||
|
ss -ntpl | grep :$_port" "
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if _exists "netstat" ; then
|
||||||
_debug "Using: netstat"
|
_debug "Using: netstat"
|
||||||
if netstat -h 2>&1 | grep "\-p proto" >/dev/null ; then
|
if netstat -h 2>&1 | grep "\-p proto" >/dev/null ; then
|
||||||
#for windows version netstat tool
|
#for windows version netstat tool
|
||||||
netstat -anb -p tcp | grep "LISTENING" | grep :$_port" "
|
netstat -anb -p tcp | grep "LISTENING" | grep :$_port" "
|
||||||
|
else
|
||||||
|
if netstat -help 2>&1 | grep "-p protocol" >/dev/null ; then
|
||||||
|
netstat -an -p tcp | grep LISTEN | grep :$_port" "
|
||||||
else
|
else
|
||||||
netstat -ntpl | grep :$_port" "
|
netstat -ntpl | grep :$_port" "
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
if command -v "ss" >/dev/null 2>&1 ; then
|
|
||||||
_debug "Using: ss"
|
|
||||||
ss -ntpl | grep :$_port" "
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user