1,478
edits
mNo edit summary |
mNo edit summary |
||
Line 12: | Line 12: | ||
Proposal let this open a command prompt accessing the MySQL bin folder will allow command line control of the MySQL server using mysql.exe and mysqladmin.exe. I have taken the opportunity to add comments, cleaned-up the script and changed order of commands slightly. | Proposal let this open a command prompt accessing the MySQL bin folder will allow command line control of the MySQL server using mysql.exe and mysqladmin.exe. I have taken the opportunity to add comments, cleaned-up the script and changed order of commands slightly. | ||
'''''Enhancement'':''' Enclose batch commands between '''pushd %~dp0''' and '''popd''' forces current working directory to the folder a batch file is located in. On completion restores original calling working directory. Allows remote processes to start servers. | |||
'''''Proposed changes:''''' | '''''Proposed changes:''''' | ||
Line 22: | Line 24: | ||
rem To Developers: Implemented %www%, and %apanel% :) | rem To Developers: Implemented %www%, and %apanel% :) | ||
rem Proposed mods MPG 14-4-2008 | rem Proposed mods MPG 14-4-2008 | ||
rem Proposed enhancement MPG 3-7-08 | |||
@echo off | @echo off | ||
rem working directory current folder | |||
pushd %~dp0 | |||
rem Command line parameters: | rem Command line parameters: | ||
rem Server_Start.bat %1 %2 %3 | rem Server_Start.bat %1 %2 %3 | ||
rem %1 = Drive letter to use | rem %1 = Drive letter to use | ||
rem %2 = mysql (run MySql server) or nomysql (do not run MySql server) | rem %2 = mysql (run MySql server) or nomysql (do not run MySql server) | ||
rem %3 = console (Open a command prompt at folder MySQL Bin) | rem %3 = console (Open a command prompt at folder MySQL Bin) | ||
rem Note: If using %2 you must set a value for %1 | rem Note: If using %2 you must set a value for %1 | ||
rem Note: If using %3 you must set values for %1 and %2 | rem Note: If using %3 you must set values for %1 and %2 | ||
rem Note: Default, uses drive W, runs the MySQL server and does not a command prompt. | rem Note: Default, uses drive W, runs the MySQL server and does not a command prompt. | ||
rem ### Is Apache running if it is jump to STARTED | rem ### Is Apache running if it is jump to STARTED | ||
rem ### First check for system error jump to Pause allows error message to be displayed. | |||
udrive\home\admin\program\pskill.exe Apache.exe | udrive\home\admin\program\pskill.exe Apache.exe | ||
if errorlevel 2 goto :PAUSE | if errorlevel 2 goto :PAUSE | ||
Line 47: | Line 53: | ||
if errorlevel 1 goto :HINT | if errorlevel 1 goto :HINT | ||
rem ### Drive was created. Create variables for paths and programs | rem ### Drive was created. Create variables for paths and programs | ||
set apachepath=\usr\local\apache2\ | set apachepath=\usr\local\apache2\ | ||
set apacheit=%Disk%:%apachepath%bin\Apache.exe -f %apachepath%conf\httpd.conf -d %apachepath%. | set apacheit=%Disk%:%apachepath%bin\Apache.exe -f %apachepath%conf\httpd.conf -d %apachepath%. | ||
Line 72: | Line 78: | ||
:NOMYSQL | :NOMYSQL | ||
rem ### Does user want to run a command prompt, if not END | rem ### Does user want to run a command prompt, if not END | ||
if "%3"=="console" goto :CONSOLE | if "%3"=="console" goto :CONSOLE | ||
goto :END | goto :END | ||
Line 78: | Line 84: | ||
:CONSOLE | :CONSOLE | ||
rem ### User wants to run a command prompt. Opens in MySQL bin | rem ### User wants to run a command prompt. Opens in MySQL bin | ||
rem ### Allows command clients to be used (musql.exe and mysqladmin.exe ) | rem ### Allows command clients to be used (musql.exe and mysqladmin.exe ) | ||
%Disk%: | %Disk%: | ||
cd \usr\local\mysql\bin | cd \usr\local\mysql\bin | ||
Line 91: | Line 97: | ||
:STARTED | :STARTED | ||
CLS | CLS | ||
echo ERROR!!! | echo ERROR!!! | ||
echo One of the instances of Apache server is started. Use stop.bat | echo One of the instances of Apache server is started. Use stop.bat | ||
Line 99: | Line 105: | ||
:END | :END | ||
rem restore original working directory | |||
popd | |||
</pre> | </pre> | ||
Line 122: | Line 132: | ||
| [[Image:uc_small_logo.gif]] || [[User:Ric|Ric]] | | [[Image:uc_small_logo.gif]] || [[User:Ric|Ric]] | ||
|} | |} | ||
[[Category: UniCenter]] | [[Category: UniCenter]] |