Commit d0f6bf882db085d4b8c7ea813f91ac49052dd3a4

Authored by Kevin G Fourie
1 parent ef7aa073

Added dmsctl.bat file to examples.

Showing 1 changed file with 92 additions and 0 deletions
examples/windows/dmsctl.bat 0 → 100644
  1 +@echo off
  2 +
  3 +rem KnowledgeTree Control Script
  4 +
  5 +
  6 +rem ============= SET ENVIRONMENT VARIABLES ==============
  7 +set INSTALL_PATH=@@BITROCK_KT_INSTALLDIR@@
  8 +set JAVA_BIN=%INSTALL_PATH%\java\bin\java.exe
  9 +rem set MAGICK_HOME=
  10 +set SOFFICE_PATH=%INSTALL_PATH%\openoffice
  11 +set SOFFICE_BIN=%SOFFICE_PATH%\program\soffice.exe
  12 +set SOFFICE_PORT=8100
  13 +set PATH=%PATH%;%INSTALL_PATH%\php\extensions
  14 +
  15 +set MysqlServiceName=@@BITROCK_MYSQL_SERVICENAME@@
  16 +set ApacheServiceName=@@BITROCK_APACHE_SERVICENAME@@
  17 +set OpenofficeServiceName=@@BITROCK_OPENOFFICE_SERVICENAME@@
  18 +set SchedulerServiceName=@@BITROCK_SCHEDULER_SERVICENAME@@
  19 +set LuceneServiceName=@@BITROCK_LUCENE_SERVICENAME@@
  20 +
  21 +
  22 +rem ============= MAIN ==============
  23 +if NOT ""%1"" == ""help"" IF NOT ""%1"" == ""start"" IF NOT ""%1"" == ""stop"" IF NOT ""%1"" == ""restart"" IF NOT ""%1"" == ""install"" IF NOT ""%1"" == ""uninstall"" goto help
  24 +goto %1
  25 +
  26 +:help
  27 +echo USAGE:
  28 +echo.
  29 +echo dmsctl.bat ^<start^|stop^|restart^|install^|uninstall^>
  30 +echo.
  31 +echo help - this screen
  32 +echo.
  33 +echo start - start the services
  34 +echo stop - stop the services
  35 +echo restart - restart the services
  36 +echo.
  37 +echo install - install the services
  38 +echo uninstall - uninstall the services
  39 +echo.
  40 +
  41 +goto end
  42 +
  43 +:start
  44 +echo Starting services
  45 +sc start %MysqlServiceName%
  46 +sc start %ApacheServiceName%
  47 +sc start %OpenofficeServiceName%
  48 +sc start %LuceneServiceName%
  49 +ping -n 7 127.0.0.1 > null
  50 +sc start %SchedulerServiceName%
  51 +IF EXIST "%INSTALL_PATH%\bin\networkservice.bat" call "%INSTALL_PATH%\bin\networkservice.bat" start
  52 +
  53 +goto end
  54 +
  55 +:stop
  56 +echo Stopping services
  57 +IF EXIST "%INSTALL_PATH%\bin\networkservice.bat" call "%INSTALL_PATH%\bin\networkservice.bat" stop
  58 +sc stop %LuceneServiceName%
  59 +sc stop %SchedulerServiceName%
  60 +sc stop %OpenofficeServiceName%
  61 +sc stop %ApacheServiceName%
  62 +ping -n 7 127.0.0.1 > null
  63 +sc stop %MysqlServiceName%
  64 +IF ""%1"" == ""restart"" goto start
  65 +goto end
  66 +
  67 +:restart
  68 +goto stop
  69 +
  70 +:install
  71 +echo Installing services
  72 +"%INSTALL_PATH%\mysql\bin\mysqld.exe" --install %MysqlServiceName% --defaults-file="%INSTALL_PATH%\mysql\my.ini"
  73 +"%INSTALL_PATH%\apache2\bin\httpd.exe" -k install -n "%ApacheServiceName%" -f "%INSTALL_PATH%\apache2\conf\httpd.conf"
  74 +"%INSTALL_PATH%\bin\winserv.exe" install %OpenofficeServiceName% -displayname "%OpenofficeServiceName%" -start auto %SOFFICE_BIN% "-accept=socket,host=127.0.0.1,port=%SOFFICE_PORT%;urp;StarOffice.ServiceManager" -nologo -headless -nofirststartwizard
  75 +
  76 +call "%INSTALL_PATH%\bin\schedulerserviceinstall.bat"
  77 +call "%INSTALL_PATH%\bin\luceneserviceinstall.bat"
  78 +IF EXIST "%INSTALL_PATH%\bin\networkservice.bat" call "%INSTALL_PATH%\bin\networkservice.bat" install
  79 +
  80 +goto end
  81 +
  82 +:uninstall
  83 +echo Uninstalling services
  84 +IF EXIST "%INSTALL_PATH%\bin\networkservice.bat" call "%INSTALL_PATH%\bin\networkservice.bat" uninstall
  85 +sc delete %LuceneServiceName%
  86 +sc delete %SchedulerServiceName%
  87 +sc delete %OpenofficeServiceName%
  88 +sc delete %ApacheServiceName%
  89 +sc delete %MysqlServiceName%
  90 +goto end
  91 +
  92 +:end