Browse Source

Add check_port script

ApisNecros 2 years ago
parent
commit
c108b77822
1 changed files with 7 additions and 0 deletions
  1. 7 0
      check_port

+ 7 - 0
check_port

@@ -0,0 +1,7 @@
+#!/bin/bash
+
+if [ ! "$1" -gt 0 ] || [ ! "$1" -lt 65536 ]; then
+	echo "Port number must be in range 1 - 65535"
+        exit 1
+fi
+ss -tulpn | grep LISTEN | grep -E ":$1\b" | grep -Po "(?<=\(\(\").+?(?=\")" | uniq