summaryrefslogtreecommitdiffstats
path: root/run-client.sh
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2018-08-06 19:04:39 +0200
committerSuren A. Chilingaryan <csa@suren.me>2018-08-06 19:04:39 +0200
commit7ae5d89c48bd3982626afe03891eab2e2d31e746 (patch)
tree490ceb49904a53f189833b1abc227b42b3217dd1 /run-client.sh
parent09b7e077f10fe324774f759086f3596947d69b19 (diff)
downloadods-7ae5d89c48bd3982626afe03891eab2e2d31e746.tar.gz
ods-7ae5d89c48bd3982626afe03891eab2e2d31e746.tar.bz2
ods-7ae5d89c48bd3982626afe03891eab2e2d31e746.tar.xz
ods-7ae5d89c48bd3982626afe03891eab2e2d31e746.zip
Client and server scripts
Diffstat (limited to 'run-client.sh')
-rwxr-xr-xrun-client.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/run-client.sh b/run-client.sh
new file mode 100755
index 0000000..e4b0f8f
--- /dev/null
+++ b/run-client.sh
@@ -0,0 +1,26 @@
+#! /bin/bash
+
+. config.sh
+
+function run {
+ $ods_path/bin/onlineDetectorSimulatorClient "$@"
+}
+
+ip=$1
+mtu=1500 #max 9000
+[ -n "$1" ] || { echo "Usage: run <ip> [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
+
+