From 4013bfd02a201f2dabc021a2c75d7c13aea40611 Mon Sep 17 00:00:00 2001 From: neil Date: Thu, 7 Jan 2016 23:17:15 +0800 Subject: [PATCH] remove dependency to "netstat" --- le.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/le.sh b/le.sh index 95c48eb..f59793c 100755 --- a/le.sh +++ b/le.sh @@ -312,14 +312,11 @@ issue() { _err "Please install netcat(nc) tools first." return 1 fi - if ! command -v "netstat" > /dev/null ; then - _err "Please install netstat first." - return 1 - fi - netprc="$(netstat -ntpl | grep ':80 ')" + + netprc="$(ss -ntpl | grep ':80 ')" if [ "$netprc" ] ; then _err "$netprc" - _err "tcp port 80 is already used by $(echo "$netprc" | cut -d '/' -f 2)" + _err "tcp port 80 is already used by $(echo "$netprc" | cut -d : -f 4)" _err "Please stop it first" return 1 fi