for PORT in $PORT_LIST
do
timeout $TIMEOUT_SEC bash -c "</dev/tcp/$REMOTE_HOST/$PORT" &>/dev/null; res=$?
if [[ $res -eq 0 ]]
then
echo "$PORT OPEN"
elif [[ $res -eq 1 ]]
then
echo "$PORT OPEN BUT NOT LISTEN"
elif [[ $res -eq 124 ]]
then
echo "$PORT NOT OPEN"
else
echo "$PORT UNKONWN ERROR"
fi
done