root/main/trunk/greenstone2/gs2-server.bat @ 22687

Revision 22687, 1.6 KB (checked in by sjm84, 9 years ago)

Changed the missing log dir message that is printed if GLI is not installed properly and the server is run

  • Property svn:executable set to *
Line 
1@echo off
2pushd "%CD%"
3CD /D "%~dp0"
4
5set GSDLHOME=%CD%
6
7:checkUserPermissions
8    echo Checking if the Greenstone log directory is writable ...
9    if not exist "%GSDLHOME%\etc\logs-gsi" goto missingLogDir
10    (echo This is a temporary file. It is safe to delete it. > "%GSDLHOME%\etc\logs-gsi\testing.tmp" ) 2>nul
11    if exist "%GSDLHOME%\etc\logs-gsi\testing.tmp" goto deleteTempFile
12    if "%1" == "Elevated" goto printWarning
13    echo ... FAILED
14    echo The Greenstone server cannot write to the log directory (%GSDLHOME%\etc\logs-gsi)
15    echo Requesting elevated status to become admin user to continue.
16    "%GSDLHOME%\bin\windows\gstart.exe" %0 Elevated %1 %2 %3 %4 %5 %6 %7 %8 %9
17    goto done
18   
19:missingLogDir
20    echo ... FAILED
21    echo The Greenstone log directory does not exist (%GSDLHOME%\etc\logs-gsi). Please either create this directory or reinstall Greenstone.
22    pause
23    goto done
24   
25:printWarning
26    echo ... FAILED
27    echo The Greenstone server cannot write to the log directory (%GSDLHOME%\etc\logs-gsi).
28    echo Attempting to continue without permissions.
29    goto shiftElevated
30
31:deleteTempFile
32    echo ... OK
33    del "%GSDLHOME%\etc\logs-gsi\testing.tmp"
34
35:shiftElevated
36    :: Shift "Elevated" (one of our own internal command words) out of the way if present
37    :: so the command-line is as it was when the user initiated the command
38    if "%1" == "Elevated" shift
39
40:checkserver
41    if exist "%GSDLHOME%\server.exe" goto localserver
42    goto webserver
43
44:localserver
45    start /MIN cmd /C "%GSDLHOME%\server.exe"
46    goto done
47   
48:webserver
49    call "%GSDLHOME%\gs2-web-server.bat"
50    goto done
51   
52:done
53popd
Note: See TracBrowser for help on using the browser.