From d4823429a2b46b3fad862c13bb1cba7cc2b38f65 Mon Sep 17 00:00:00 2001 From: Nils <32552517+byReqz@users.noreply.github.com> Date: Fri, 15 Jan 2021 14:50:17 +0000 Subject: [PATCH] initial release --- conn.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 conn.sh diff --git a/conn.sh b/conn.sh new file mode 100644 index 0000000..20b2941 --- /dev/null +++ b/conn.sh @@ -0,0 +1,31 @@ +#! /bin/bash +if [[ -z "$1" ]]; then + echo "Usage: conn [ip] (y/n)" + exit +elif [[ -n "$1" ]]; then + echo "checking connection status for $1" + echo "-----------------------------------------" + fping $1 + echo "-----------------------------------------" +fi +if [[ -z "$2" ]]; then + echo "portscan? (y/n)" + read portscan + if [[ "$portscan" = "y" ]]; then + echo "-------------------Portscan---------------------" + nmap -Pn $1 + fping -c 4 -A $1 + echo "------------------------------------------------" + exit + elif [[ "$portscan" = "n" ]]; then + exit + fi +elif [[ "$2" = "y" ]]; then + echo "-------------------Portscan---------------------" + nmap -Pn $1 + fping -c 4 -A $1 + echo "------------------------------------------------" + exit +elif [[ "$2" = "n" ]]; then + exit +fi \ No newline at end of file