|
From: Leif M. <le...@ta...> - 2003-10-03 17:54:59
|
Mike,
Thanks for all the work you put into this and sorry for the slow response.
Here are my thoughts on this. I want to keep the existing batch files around
to give the users options. But personally, I think I will start using
your new
script. It looks great.
I am planning to add the new batch file as src/bin/AppCommand.bat.in
I am not totally happy with the name. Do you have any other ideas.
I don't really see any reason to put in the deprecated code as this will be
a new script. I know you were planning to replace the old script, so it
would
have been valid.
I also removed the code to create the logs directory. Its location will
depend on the configuration in the wrapper.conf file so it can't be hard
coded into the batch file. There has been a feature request to create the
batch file if it does not exist for a while, so I'll try to get that
implemented
in a cross platform way for the next release.
The batch file that I committed, with the above changes can be found at
the end of this mail. Let me know if you have any other suggestions. From
my testing so far, it looks great though. Good work.
Cheers,
Leif
@echo off
setlocal
rem
rem Find the application home.
rem
rem %~dp0 is name of current script under NT
set _REALPATH=%~dp0
set _WRAPPER_EXE=%_REALPATH%Wrapper.exe
rem Find the requested command.
for /F %%v in ('echo %1^|findstr "^console$ ^start$ ^stop$ ^restart$
^install$ ^remove"') do call :exec set COMMAND=%%v
if "%COMMAND%" == "" (
echo Usage: %0 { console : start : stop : restart : install : remove }
pause
goto :eof
) else (
shift
)
rem
rem Find the wrapper.conf
rem
:conf
set _WRAPPER_CONF="%_REALPATH%..\conf\wrapper.conf"
rem
rem Run the application.
rem At runtime, the current directory will be that of Wrapper.exe
rem
call :%COMMAND%
if errorlevel 1 pause
goto :eof
:console
echo on
"%_WRAPPER_EXE%" -c %_WRAPPER_CONF%
goto :eof
:start
"%_WRAPPER_EXE%" -t %_WRAPPER_CONF%
goto :eof
:stop
"%_WRAPPER_EXE%" -p %_WRAPPER_CONF%
goto :eof
:install
"%_WRAPPER_EXE%" -i %_WRAPPER_CONF%
goto :eof
:remove
"%_WRAPPER_EXE%" -r %_WRAPPER_CONF%
goto :eof
:restart
call :stop
call :start
goto :eof
:exec
%*
goto :eof
|