summaryrefslogtreecommitdiffstats
path: root/run-server.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-server.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-server.sh')
-rwxr-xr-xrun-server.sh10
1 files changed, 7 insertions, 3 deletions
diff --git a/run-server.sh b/run-server.sh
index 7d29c10..99330c2 100755
--- a/run-server.sh
+++ b/run-server.sh
@@ -8,9 +8,13 @@ function run {
ip=$1
+first_port=4000
+num_ports=27
mtu=1500 #max 9000
-[ -n "$1" ] || { echo "Usage: run <ip> [mtu]" ; exit 1 ; }
-[ -n "$2" ] && mtu=$2
+[ -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
ipinfo=$(ip addr show | grep $ip)
[ $? -eq 0 ] || { echo "Specified IP $ip is not found" ; exit 1 ; }
@@ -22,4 +26,4 @@ echo 8000 > /proc/sys/vm/nr_hugepages # 0
ip link set $int mtu $mtu
-run $ip
+run $ip $first_port $num_ports