diff --git a/distribution/openhabhome/start.bat b/distribution/openhabhome/start.bat index e3f59204ab5..5fa80a1911b 100755 --- a/distribution/openhabhome/start.bat +++ b/distribution/openhabhome/start.bat @@ -4,10 +4,26 @@ set ECLIPSEHOME="runtime/server" :: set ports for HTTP(S) server +:check_http_port +IF NOT [%OPENHAB_HTTP_PORT%] == [] GOTO :http_port_set set HTTP_PORT=8080 +goto :check_https_port + +:http_port_set +set HTTP_PORT=%OPENHAB_HTTP_PORT% +goto :check_https_port + +:check_https_port +IF NOT [%OPENHAB_HTTPS_PORT%] == [] GOTO :https_port_set set HTTPS_PORT=8443 - +goto :check_path + +:https_port_set +set HTTPS_PORT=%OPENHAB_HTTPS_PORT% +goto :check_path + :: get path to equinox jar inside ECLIPSEHOME folder +:check_path for /f "delims= tokens=1" %%c in ('dir /B /S /OD %ECLIPSEHOME%\plugins\org.eclipse.equinox.launcher_*.jar') do set EQUINOXJAR=%%c IF NOT [%EQUINOXJAR%] == [] GOTO :Launch diff --git a/distribution/openhabhome/start.sh b/distribution/openhabhome/start.sh index 289c7c1178f..46723d921fd 100755 --- a/distribution/openhabhome/start.sh +++ b/distribution/openhabhome/start.sh @@ -6,8 +6,19 @@ cd `dirname $0` eclipsehome="runtime/server"; # set ports for HTTP(S) server -HTTP_PORT=8080 -HTTPS_PORT=8443 +if [ ! -z ${OPENHAB_HTTP_PORT} ] +then + HTTP_PORT=${OPENHAB_HTTP_PORT} +else + HTTP_PORT=8080 +fi + +if [ ! -z ${OPENHAB_HTTPS_PORT} ] +then + HTTPS_PORT=${OPENHAB_HTTPS_PORT} +else + HTTPS_PORT=8443 +fi # get path to equinox jar inside $eclipsehome folder cp=$(find $eclipsehome -name "org.eclipse.equinox.launcher_*.jar" | sort | tail -1); diff --git a/distribution/openhabhome/start_debug.bat b/distribution/openhabhome/start_debug.bat index 4fbdc566706..87bee97f64c 100755 --- a/distribution/openhabhome/start_debug.bat +++ b/distribution/openhabhome/start_debug.bat @@ -4,10 +4,26 @@ set ECLIPSEHOME="runtime/server" :: set ports for HTTP(S) server +:check_http_port +IF NOT [%OPENHAB_HTTP_PORT%] == [] GOTO :http_port_set set HTTP_PORT=8080 +goto :check_https_port + +:http_port_set +set HTTP_PORT=%OPENHAB_HTTP_PORT% +goto :check_https_port + +:check_https_port +IF NOT [%OPENHAB_HTTPS_PORT%] == [] GOTO :https_port_set set HTTPS_PORT=8443 +goto :check_path + +:https_port_set +set HTTPS_PORT=%OPENHAB_HTTPS_PORT% +goto :check_path :: get path to equinox jar inside ECLIPSEHOME folder +:check_path for /f "delims= tokens=1" %%c in ('dir /B /S /OD %ECLIPSEHOME%\plugins\org.eclipse.equinox.launcher_*.jar') do set EQUINOXJAR=%%c IF NOT [%EQUINOXJAR%] == [] GOTO :Launch diff --git a/distribution/openhabhome/start_debug.sh b/distribution/openhabhome/start_debug.sh index c03aaad2bf3..8881d69de01 100755 --- a/distribution/openhabhome/start_debug.sh +++ b/distribution/openhabhome/start_debug.sh @@ -6,8 +6,19 @@ cd `dirname $0` eclipsehome="runtime/server"; # set ports for HTTP(S) server -HTTP_PORT=8080 -HTTPS_PORT=8443 +if [ ! -z ${OPENHAB_HTTP_PORT} ] +then + HTTP_PORT=${OPENHAB_HTTP_PORT} +else + HTTP_PORT=8080 +fi + +if [ ! -z ${OPENHAB_HTTPS_PORT} ] +then + HTTPS_PORT=${OPENHAB_HTTPS_PORT} +else + HTTPS_PORT=8443 +fi # get path to equinox jar inside $eclipsehome folder cp=$(find $eclipsehome -name "org.eclipse.equinox.launcher_*.jar" | sort | tail -1);