From 5ed67a6507d54f6cd3e6705ade5df590d641f58a Mon Sep 17 00:00:00 2001 From: Henrik Fehlauer Date: Thu, 30 May 2019 23:52:59 +0200 Subject: [PATCH] Merge server.sh and local.sh By setting BINDADDRESS and delegating to server.sh we can avoid duplicating most of the code. This also makes 0d5e1c1 available for local.sh, i.e. being able to launch local.sh from arbitrary directories too. --- misc/scripts/standalone/local.sh | 9 +-------- misc/scripts/standalone/server.sh | 4 ++-- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/misc/scripts/standalone/local.sh b/misc/scripts/standalone/local.sh index 972b038..8211acf 100755 --- a/misc/scripts/standalone/local.sh +++ b/misc/scripts/standalone/local.sh @@ -1,10 +1,3 @@ #!/bin/sh -# BRouter standalone server -# java -cp brouter.jar btools.brouter.RouteServer [bindaddress] - -# maxRunningTime is the request timeout in seconds, set to 0 to disable timeout -JAVA_OPTS="-Xmx128M -Xms128M -Xmn8M -DmaxRunningTime=300" -CLASSPATH=../brouter.jar - -java $JAVA_OPTS -cp $CLASSPATH btools.server.RouteServer ../segments4 ../profiles2 ../customprofiles 17777 1 localhost +BINDADDRESS="localhost" "$(dirname "$0")/server.sh" diff --git a/misc/scripts/standalone/server.sh b/misc/scripts/standalone/server.sh index f37b0d8..9ea86a8 100755 --- a/misc/scripts/standalone/server.sh +++ b/misc/scripts/standalone/server.sh @@ -2,10 +2,10 @@ cd "$(dirname "$0")" # BRouter standalone server -# java -cp brouter.jar btools.brouter.RouteServer +# java -cp brouter.jar btools.brouter.RouteServer [bindaddress] # maxRunningTime is the request timeout in seconds, set to 0 to disable timeout JAVA_OPTS="-Xmx128M -Xms128M -Xmn8M -DmaxRunningTime=300" CLASSPATH=../brouter.jar -java $JAVA_OPTS -cp $CLASSPATH btools.server.RouteServer ../segments4 ../profiles2 ../customprofiles 17777 1 +java $JAVA_OPTS -cp $CLASSPATH btools.server.RouteServer ../segments4 ../profiles2 ../customprofiles 17777 1 $BINDADDRESS