[vlma-devel] commit: Startup script for VLMaw under Windows. (Adrien Grand )
git version control
git at videolan.org
Sun Aug 31 13:34:19 CEST 2008
vlma | branch: master | Adrien Grand <jpountz at videolan.org> | Sun Aug 31 12:32:37 2008 +0200| [c459e9b6049faab108b4460fc213c79261c1eae2] | committer: Adrien Grand
Startup script for VLMaw under Windows.
> http://git.videolan.org/gitweb.cgi/vlma.git/?a=commit;h=c459e9b6049faab108b4460fc213c79261c1eae2
---
vlma-distribution/src/bin/build_cp.cmd | 2 +-
vlma-distribution/src/bin/vlma-env.cmd | 55 +++++++++++++++++++++++++
vlma-distribution/src/bin/vlmad.bat | 68 ++++++--------------------------
vlma-distribution/src/bin/vlmaw.bat | 43 ++++++++++++++++++++
4 files changed, 111 insertions(+), 57 deletions(-)
diff --git a/vlma-distribution/src/bin/build_cp.cmd b/vlma-distribution/src/bin/build_cp.cmd
index 4e2579f..725a3bd 100644
--- a/vlma-distribution/src/bin/build_cp.cmd
+++ b/vlma-distribution/src/bin/build_cp.cmd
@@ -1,2 +1,2 @@
-set VLMA_CLASSPATH=%CLASSPATH%
+set VLMA_CLASSPATH=
for %%i in ( %1\*.jar ) do call bin\cp_append.cmd %%~fsi
diff --git a/vlma-distribution/src/bin/vlma-env.cmd b/vlma-distribution/src/bin/vlma-env.cmd
new file mode 100644
index 0000000..342df10
--- /dev/null
+++ b/vlma-distribution/src/bin/vlma-env.cmd
@@ -0,0 +1,55 @@
+rem Detect JAVA installation
+if not "%JAVA_HOME%" == "" goto gotJavaHome
+echo [ERROR] JAVA_HOME is not defined.
+echo [ERROR] You either need to install a JDK 5.0 or later,
+echo [ERROR] or to set the JAVA_HOME environment variable if a JDK is already installed.
+goto end
+
+:gotJavaHome
+set JAVA=%JAVA_HOME%\bin\java.exe
+if exist "%JAVA%" goto gotJava
+echo [ERROR] Cannot find the JAVA executable.
+echo [ERROR] Please verify that JAVA_HOME really points to a JDK installation.
+goto end
+
+:gotJava
+rem Set VLMA_HOME
+if not "%VLMA_HOME%" == "" goto gotHome
+cd /d %~dp0%
+cd ..
+set VLMA_HOME=%cd%
+
+:gotHome
+echo [INFO] Using VLMA_HOME: %VLMA_HOME%
+cd %VLMA_HOME%
+
+if not "%VLMA_CONF%" == "" goto gotConf
+set VLMA_CONF=%VLMA_HOME%\conf
+:gotConf
+echo [INFO] Using VLMA_CONF: %VLMA_CONF%
+
+if not "%VLMA_DATA%" == "" goto gotData
+set VLMA_DATA=%VLMA_HOME%\data
+:gotData
+echo [INFO] Using VLMA_DATA: %VLMA_DATA%
+
+if not "%VLMA_LIBS%" == "" goto gotLibs
+set VLMA_LIBS=%VLMA_HOME%\lib
+:gotLibs
+echo [INFO] Using VLMA_LIBS: %VLMA_LIBS%
+
+if not "%VLMA_LOGS%" == "" goto gotLogs
+set VLMA_LOGS=%VLMA_HOME%\logs
+:gotLogs
+echo [INFO] Using VLMA_LOGS: %VLMA_LOGS%
+
+if not "%VLMA_WEBAPPS%" == "" goto gotWebapps
+set VLMA_WEBAPPS=%VLMA_HOME%\webapps
+:gotWebapps
+echo [INFO] Using VLMA_WEBAPPS: %VLMA_WEBAPPS%
+
+if not "%VLMA_WORK%" == "" goto gotWork
+set VLMA_WORK=%VLMA_HOME%\work
+:gotWork
+echo [INFO] Using VLMA_WORK: %VLMA_WORK%
+
diff --git a/vlma-distribution/src/bin/vlmad.bat b/vlma-distribution/src/bin/vlmad.bat
index 58dbfb7..ba3bfb6 100644
--- a/vlma-distribution/src/bin/vlmad.bat
+++ b/vlma-distribution/src/bin/vlmad.bat
@@ -2,75 +2,31 @@
rem VLMad startup script
set command=
-if "%1" == "start" set command=start
-if "%1" == "stop" set command=stop
-if "%1" == "reload" set command=reload
-if "%command%" == "" goto usage
+if "%1" == "start" goto env
+if "%1" == "stop" goto env
+if "%1" == "reload" goto env
+goto usage
-rem Detect JAVA installation
-if not "%JRE_HOME%" == "" goto gotJreHome
-if not "%JAVA_HOME%" == "" goto gotJdkHome
-echo [ERROR] Neither JAVA_HOME nor JRE_HOME is defined.
-goto end
-
-:gotJavaHome
-set JRE_HOME=%JAVA_HOME%
-
-:gotJreHome
-set JAVA=%JRE_HOME%\bin\java.exe
-if exist "%JAVA%" goto gotJava
-echo [ERROR] Cannot find the JAVA executable.
-echo [ERROR] Please verify the value of JAVA_HOME and/or JRE_HOME.
-goto end
+:env
+set command=%1
-:gotJava
-rem Set VLMA_HOME
-if not "%VLMA_HOME%" == "" goto gotHome
cd /d %~dp0%
-cd ..
-set VLMA_HOME=%cd%
-
-:gotHome
-echo [INFO] Using VLMA_HOME: %VLMA_HOME%
-cd %VLMA_HOME%
-
-if not "%VLMA_CONF%" == "" goto gotConf
-set VLMA_CONF=%VLMA_HOME%\conf
-:gotConf
-echo [INFO] Using VLMA_CONF: %VLMA_CONF%
+call vlma-env.cmd
-if not "%VLMA_DATA%" == "" goto gotData
-set VLMA_DATA=%VLMA_HOME%\data
-:gotData
-echo [INFO] Using VLMA_DATA: %VLMA_DATA%
+call bin\build_cp.cmd "%VLMA_LIBS%\daemon"
-if not "%VLMA_LIBS%" == "" goto gotLibs
-set VLMA_LIBS=%VLMA_HOME%\lib
-:gotLibs
-echo [INFO] Using VLMA_LIBS: %VLMA_LIBS%
-
-if not "%VLMA_LOGS%" == "" goto gotLogs
-set VLMA_LOGS=%VLMA_HOME%\logs
-:gotLogs
-echo [INFO] Using VLMA_LOGS: %VLMA_LOGS%
-
-if not "%VLMA_WORK%" == "" goto gotWork
-set VLMA_WORK=%VLMA_HOME%\work
-:gotWork
-echo [INFO] Using VLMA_WORK: %VLMA_WORK%
-
-call bin\build_cp.cmd "%VLMA_LIBS%"
-
-set VLMA_OPTS=%VLMA_OPTS% -Dvlma.home="%VLMA_HOME%" -Dvlma.conf="%VLMA_CONF%" -Dvlma.data="%VLMA_DATA%" -Dvlma.logs="%VLMA_LOGS%" -Dvlma.work="%VLMA_WORK%" -Dlog4j.configuration="file:%VLMA_CONF%\log4j.properties" -classpath %VLMA_CLASSPATH%
+set VLMA_OPTS=-Dvlma.home="%VLMA_HOME%" -Dvlma.conf="%VLMA_CONF%" -Dvlma.data="%VLMA_DATA%" -Dvlma.logs="%VLMA_LOGS%" -Dvlma.work="%VLMA_WORK%" -Dlog4j.configuration="file:%VLMA_CONF%\log4j.properties" -classpath %VLMA_CLASSPATH%
set OPTS=%VLMA_OPTS% %JAVA_OPTS% org.videolan.vlma.daemon.VLMad %command%
+
echo [INFO] Launching %JAVA% %OPTS%
rem Run VLMad
"%JAVA%" %OPTS%
goto end
+
:usage
-echo usage: vlmad.bat (start^|stop^|reload)
+echo usage: vlmad.bat (start^|stop^|reload^|help)
:end
diff --git a/vlma-distribution/src/bin/vlmaw.bat b/vlma-distribution/src/bin/vlmaw.bat
new file mode 100644
index 0000000..839c3a5
--- /dev/null
+++ b/vlma-distribution/src/bin/vlmaw.bat
@@ -0,0 +1,43 @@
+ at echo OFF
+rem VLMaw startup script
+
+set command=
+if "%1" == "start" goto env
+if "%1" == "stop" goto env
+goto usage
+
+:env
+set command=%1
+
+cd /d %~dp0%
+call vlma-env.cmd
+
+call bin\build_cp.cmd "%VLMA_LIBS%\web"
+set VLMA_CLASSPATH=%VLMA_CLASSPATH%;"%JAVA_HOME%\lib\tools.jar"
+
+set VLMA_OPTS=-Dvlma.home="%VLMA_HOME%" -Dvlma.conf="%VLMA_CONF%" -Dvlma.logs="%VLMA_LOGS%" -Djetty.lib="%VLMA_LIBS%\web" -Dvlma.webapps="%VLMA_WEBAPPS%" -DSTOP.PORT=8079 -DSTOP.KEY=vlmaw -classpath %VLMA_CLASSPATH%
+
+set OPTS=%VLMA_OPTS% %JAVA_OPTS% org.mortbay.start.Main
+
+if "%command%" == "start" goto start
+if "%command%" == "stop" goto stop
+
+:start
+set OPTS=%OPTS% "%VLMA_CONF%\jetty.xml"
+goto run
+
+:stop
+set OPTS=%OPTS% --stop
+
+:run
+echo [INFO] Launching %JAVA% %OPTS%
+
+rem Run VLMaw
+"%JAVA%" %OPTS%
+
+goto end
+
+:usage
+echo usage: vlmaw.bat (start^|stop^|help)
+
+:end
More information about the vlma-devel
mailing list