From dd7c7e7e0c7f045ef14c7f971bc7d1c38403d482 Mon Sep 17 00:00:00 2001 From: arch-enemy Date: Thu, 2 Mar 2023 10:53:00 +0100 Subject: [PATCH] Added bash script to check if a remote port is reachable. --- bin/executable_tcp-check.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 bin/executable_tcp-check.sh diff --git a/bin/executable_tcp-check.sh b/bin/executable_tcp-check.sh new file mode 100644 index 0000000..81d891a --- /dev/null +++ b/bin/executable_tcp-check.sh @@ -0,0 +1,13 @@ +#!/bin/bash +# +# Vom ITZ Wiki abgeschaut + +host=${1:-127.0.0.1} +port=${2:-22} + +if echo "Hi from poor man's scanner at $(uname -n)" 2>/dev/null > /dev/tcp/"$host"/"$port" +then + echo -e "\033[32m success at $host:$port \033[0m" +else + echo -e "\033[31m failure at $host:$port \033[0m" +fi