111
This commit is contained in:
9
run.sh
9
run.sh
@@ -14,9 +14,13 @@ is_port_listening() {
|
|||||||
if command -v lsof >/dev/null 2>&1; then
|
if command -v lsof >/dev/null 2>&1; then
|
||||||
lsof -iTCP:2333 -sTCP:LISTEN >/dev/null 2>&1
|
lsof -iTCP:2333 -sTCP:LISTEN >/dev/null 2>&1
|
||||||
elif command -v ss >/dev/null 2>&1; then
|
elif command -v ss >/dev/null 2>&1; then
|
||||||
ss -ltn 2>/dev/null | awk '{print $4}' | grep -Eq '(^|[[:space:]])([^[:space:]]*:)?2333$'
|
if ss -ltnH 'sport = :2333' >/dev/null 2>&1; then
|
||||||
|
ss -ltnH 'sport = :2333' 2>/dev/null | grep -q .
|
||||||
|
else
|
||||||
|
ss -ltn 2>/dev/null | grep -E '[:.]2333([[:space:]]|$)' | grep -q .
|
||||||
|
fi
|
||||||
elif command -v netstat >/dev/null 2>&1; then
|
elif command -v netstat >/dev/null 2>&1; then
|
||||||
netstat -ltn 2>/dev/null | awk '{print $4}' | grep -Eq '(^|[[:space:]])([^[:space:]]*:)?2333$'
|
netstat -ltn 2>/dev/null | grep -E '[:.]2333([[:space:]]|$)' | grep -q .
|
||||||
elif command -v fuser >/dev/null 2>&1; then
|
elif command -v fuser >/dev/null 2>&1; then
|
||||||
fuser -n tcp 2333 >/dev/null 2>&1
|
fuser -n tcp 2333 >/dev/null 2>&1
|
||||||
else
|
else
|
||||||
@@ -185,4 +189,3 @@ case "$1" in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user