From 781817ed37c31041d4c4ffe690e70b937e46420d Mon Sep 17 00:00:00 2001 From: jc Date: Tue, 24 Jun 2025 04:01:11 +0000 Subject: [PATCH] absolutely obsessed with my oneliners --- portradar.sh | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/portradar.sh b/portradar.sh index db55bd1..6f9d1a0 100755 --- a/portradar.sh +++ b/portradar.sh @@ -245,14 +245,7 @@ while [ "$1" != "" ]; do case $1 in -p | --port) shift - if [[ $1 =~ ^[0-9]+$ && $1 -le 65535 ]]; then - port=$1 - elif [[ $1 =~ ^[0-9]+(,[0-9]+)+$ ]]; then - for p in ${1//,/ }; do [[ $p -gt 65535 ]] && help; done; mports=$1 - else - help - exit - fi + [[ $1 =~ ^[0-9]+$ && $1 -le 65535 ]] && { port=$1; } || { [[ $1 =~ ^[0-9]+(,[0-9]+)+$ ]] && { for p in ${1//,/ }; do [[ $p -gt 65535 ]] && help; done; mports=$1; }; } || { help; exit; } ;; --nmap) RUN_NMAP=true @@ -273,16 +266,7 @@ while [ "$1" != "" ]; do HTTPX=true ;; *) - if [[ $1 =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - ip=$1 - elif [[ $1 =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/[0-9]+$ ]]; then - cidr=$1 - elif [[ -f $1 ]]; then - ipocalypse=($(<$1)) - else - help - exit - fi + [[ $1 =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]] && { ip=$1; } || { [[ $1 =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/[0-9]+$ ]] && { cidr=$1; }; } || { [[ -f $1 ]] && { ipocalypse=($(<$1)); }; } || { help; exit; } ;; esac shift