#! /bin/bash . config.sh function run { $ods_path/bin/onlineDetectorSimulatorClient "$@" } ip=$1 mtu=1500 #max 9000 [ -n "$1" ] || { echo "Usage: run [mtu]" ; exit 1 ; } [ -n "$2" ] && mtu=$2 int=$(ip route show to match "$ip" | grep src | awk '{ print $3 }') ip link set $int mtu $mtu if [ $mtu -le 1500 ]; then sed -i '' -e 's/numberOfProjectionsPerPacket.*/numberOfProjectionsPerPacket = 40/' config.cfg run 80000 "$ip" elif [ $mtu -eq 9000 ]; then sed -i '' -e 's/numberOfProjectionsPerPacket.*/numberOfProjectionsPerPacket = 250/' config.cfg run 20000 "$ip" fi