source: main/trunk/greenstone2/gs2-server.bat@ 24829

Last change on this file since 24829 was 24829, checked in by ak19, 9 years ago

Changes to bat files and perl code to deal with brackets in (Windows) filepath. Also checked winmake.bat files to see if changes were needed there. These changes go together with the commits 24826 to 24828 for gems.bat, and commit 24820 on makegs2.bat.

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