summaryrefslogtreecommitdiffstats
path: root/run-client.sh
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2018-08-06 20:20:46 +0200
committerSuren A. Chilingaryan <csa@suren.me>2018-08-06 20:20:46 +0200
commit254f1dc9e629e9de818672174a6614c6595fb11a (patch)
tree39786da7f579f3098c5a79fe9c129dae2fd3ef5c /run-client.sh
parent7ae5d89c48bd3982626afe03891eab2e2d31e746 (diff)
downloadods-254f1dc9e629e9de818672174a6614c6595fb11a.tar.gz
ods-254f1dc9e629e9de818672174a6614c6595fb11a.tar.bz2
ods-254f1dc9e629e9de818672174a6614c6595fb11a.tar.xz
ods-254f1dc9e629e9de818672174a6614c6595fb11a.zip
Support arbitrary ports and port-range splitting
Diffstat (limited to 'run-client.sh')
-rwxr-xr-xrun-client.sh12
1 files changed, 8 insertions, 4 deletions
diff --git a/run-client.sh b/run-client.sh
index e4b0f8f..7ed9967 100755
--- a/run-client.sh
+++ b/run-client.sh
@@ -8,8 +8,12 @@ function run {
ip=$1
mtu=1500 #max 9000
-[ -n "$1" ] || { echo "Usage: run <ip> [mtu]" ; exit 1 ; }
-[ -n "$2" ] && mtu=$2
+first_port=4000
+num_ports=27
+[ -n "$1" ] || { echo "Usage: run <ip> [first_port] [num_ports] [mtu]" ; exit 1 ; }
+[ -n "$2" ] && first_port=$2
+[ -n "$3" ] && num_ports=$3
+[ -n "$4" ] && mtu=$4
int=$(ip route show to match "$ip" | grep src | awk '{ print $3 }')
@@ -17,10 +21,10 @@ ip link set $int mtu $mtu
if [ $mtu -le 1500 ]; then
sed -i '' -e 's/numberOfProjectionsPerPacket.*/numberOfProjectionsPerPacket = 40/' config.cfg
- run 80000 "$ip"
+ run "$ip" $first_port $num_ports 120000
elif [ $mtu -eq 9000 ]; then
sed -i '' -e 's/numberOfProjectionsPerPacket.*/numberOfProjectionsPerPacket = 250/' config.cfg
- run 20000 "$ip"
+ run "$ip" $first_port $num_ports 20000
fi