From b8de98fb32fc8e3727c02e9b3dd18e1ea1ea543a Mon Sep 17 00:00:00 2001 From: jc Date: Fri, 2 May 2025 19:36:31 +0300 Subject: [PATCH] resource management -> 80% max cpu usage: Thread(s) per core: 1, Core(s) per socket: 2, Socket(s): 2 --- portradar.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/portradar.sh b/portradar.sh index c84efc7..f45457a 100755 --- a/portradar.sh +++ b/portradar.sh @@ -75,16 +75,14 @@ fast_ping(){ } scan_tcp(){ - [[ $1 ]] && { [[ $1 =~ ^[0-9]+$ ]] && { c=$1; ret=$(nc -zn -w2 $ip $c >/dev/null 2>&1; echo $?); [[ $ret == 0 ]] && echo $c >> /tmp/tcp_ports; } || { ports=${1//,/ }; for c in ${ports[@]}; do ret=$(nc -zn -w2 $ip $c >/dev/null 2>&1; echo $?); [[ $ret == 0 ]] && echo $c >> /tmp/tcp_ports; done; }; [[ -f /tmp/tcp_ports ]] && { [[ $RUN_NMAP == true ]] && { command="nmap -Pn -n -sCV -p $(allports=($(/dev/null 2>&1; echo $?); [[ $ret == 0 ]] && echo $c >> /tmp/tcp_ports; } || { for c in ${mports[@]}; do ret=$(nc -zn -w2 $ip $c >/dev/null 2>&1; echo $?); [[ $ret == 0 ]] && echo $c >> /tmp/tcp_ports; done; }; [[ -f /tmp/tcp_ports ]] && { [[ $RUN_NMAP == true ]] && { command="nmap -Pn -n -sCV -p $(allports=($(