check and edit this script to be more performance : "#!/bin/bash

RED="\e[31m"
YELLOW="\e[33m"
GREEN="\e[32m"
ENDCOLOR="\e[0m"

source ./progress-bar.sh

current_time=$(date "+%Y-%m-%d-%H:%M:%S")
address=192.168.1.250 #server address
PING_CMD="ping -t 3 -c 1 ${address} > /dev/null 2>&1"

read -p "Which Switch do you like to test [1 (Managed) or 2 (Unmanaged)]: " switch_version
read -p "How many ports has Switch [5 or 16]: " ports
read -p "Which port do you need to check? [Hit Enter to scan all]: " port
read -p "How many seconds you need to test each port: " time
read -p "Please write Switch Serial Number: " serial_number

tcp_packet_tmp="/tmp/tcp_packet_tmp.dat"
tcp_packet_ret_tmp="/tmp/tcp_packet_ret_tmp.dat"
tcp_packet_after_tmp="/tmp/tcp_packet_after_tmp.dat"
tcp_packet_ret_after_tmp="/tmp/tcp_packet_ret_after_tmp.dat"
tcp_packet_trasmited="/tmp/tcp_packet_trasmited.dat"
tcp_packet_retrasmited="/tmp/tcp_packet_retrasmited.dat"
percentual_packet_ret="/tmp/percentual_packet_ret.dat"


managed_log=~/opt/switch_test/switch_test_logs/iperf_${ports}_ports_managed_switch_${serial_number}.log
unmanaged_log=~/opt/switch_test/switch_test_logs/iperf_${ports}_ports_unmanaged_switch_${serial_number}.log

mkdir -p ~/opt/switch_test/switch_test_logs

if [[ -z "$switch_version" || -z "$ports" ]]; then
		echo "Either you have not entered the Switch version, or you have not entered the ports!"
		exit 1
else
#---------------------------------------------- Managed Switch 16 Ports ----------------------------------------------#
