| 12345678910111213141516171819202122232425262728293031323334353637383940 | #!/bin/bash# Run script with sudo!# NOTE: Rebuild IAP with DUMMY_PROG option enabled to skip any read/write ioperations during the test.ETH=enp5s0IP=$1MTU_MIN=400MTU_MAX=1500total=()failed=()success=()echo "Test MTUs: $MTU_MIN - $MTU_MAX"for (( size=$MTU_MIN; size<=$MTU_MAX; size++ ))do	ifconfig enp5s0 mtu $size	MTU=$(ifconfig $ETH | grep MTU | awk '{print $5}' | awk -F ":" '{print $2}')	total+=($MTU)	./tools/upload.sh $IP > /dev/null 2>&1	if [ $? -eq 0 ]	then		echo "MTU $MTU - OK"		success+=($MTU)	else		echo "MTU $MTU - Error"		failed+=($MTU)		# IAP will reboot automaticaly by timeout		echo "Waiting IAP reboot timeout..."		sleep 25	fi	sleep 5doneecho "Success: ${#success[@]}/${#total[@]}"if [ ${#failed[@]} -ne 0 ]then	echo "Failed: ${#failed[@]}/${#total[@]}"	echo "Failed MTUs: ${failed[@]}"fi
 |