source: gs3-extensions/solr/trunk/src/gs3-setup.sh

Last change on this file was 35650, checked in by davidb, 3 years ago

Tweaks to echo statements. Tidy up of commented out code

File size: 2.7 KB
Line 
1
2extdesc="the Solr Extension"
3
4full_setup=`pwd`/${BASH_SOURCE}
5fulldir=${full_setup%/*}
6fulldir=${fulldir%/.}
7
8#--
9# Edit the following two port values if they conflict with
10# with existing services on your computer
11#--
12
13# If using tomcat, read the tomcat host and port from the toplevel GS3 build.properties
14# http://en.kioskea.net/faq/1757-how-to-read-a-file-line-by-line
15# The following sets the field separator IFS to the = sign, then reads the file line by
16# line, setting propname and propval (which are fields separated by '=') for each line read
17SOLR_PORT=8383
18SOLR_HOST=127.0.0.1
19file=$GSDL3SRCHOME/build.properties
20# The Solr servlet should only be locally accessible, thus restricting the protocol to http as
21# https certificates can't be issued for localhost/127.0.0.1 (https://letsencrypt.org/docs/certificates-for-localhost/)
22# This means we use the properties localhost.server.http (defaults to 127.0.0.1) and localhost.port.http
23# to construct the solr servlet url, rather than properties tomcat.server and tomcat.port.https
24while IFS== read propname propval; do
25 if [ "x$propname" = "xlocalhost.server.http" ] ; then
26 SOLR_HOST=$propval
27 fi
28 if [ "x$propname" = "xlocalhost.port.http" ] ; then
29 SOLR_PORT=$propval
30 fi
31done < $file
32
33
34if test -z $GSDLOS ; then
35 GSDLOS=`uname -s | tr '[A-Z]' '[a-z]'`
36 # check for running bash under Cygwin
37 if test "`echo $GSDLOS | sed 's/cygwin//'`" != "$GSDLOS" ;
38 then
39 GSDLOS=windows
40 fi
41 # check for running bash under MinGW/MSys
42 if test "`echo $GSDLOS | sed 's/mingw//'`" != "$GSDLOS" ;
43 then
44 GSDLOS=windows
45 fi
46 echo "GSDLOS was not set. Setting it to '$GSDLOS'"
47 export GSDLOS
48fi
49
50#first_time=0;
51
52if [ "x$GEXT_SOLR" = "x" ] ; then
53 export GEXT_SOLR=`pwd`
54
55 if [ -d "$GEXT_SOLR/bin/script" ] ; then
56 export PATH=$GEXT_SOLR/bin/script:$PATH
57 fi
58
59 if [ -d "$GEXT_SOLR/lib" ] ; then
60 if [ "$GSDLOS" = "linux" ] ; then
61 export LD_LIBRARY_PATH=$GEXT_SOLR/lib:$LD_LIBRARY_PATH
62 elif [ "$GSDLOS" = "darwin" ] ; then
63 export DYLD_LIBRARY_PATH=$GEXT_SOLR/lib:$DYLD_LIBRARY_PATH
64 fi
65 fi
66
67 extdir=${GEXT_SOLR##*/}
68
69 if [ "x$GSDL3EXTS" = "x" ] ; then
70 export GSDL3EXTS=$extdir
71 else
72 export GSDL3EXTS=$GSDL3EXTS:$extdir
73 fi
74
75 export SOLR_PORT
76 export SOLR_HOST
77# first_time=1
78
79 echo "+Your environment is now setup for $extdesc"
80else
81 echo "+Your environment is already setup for $extdesc"
82fi
83
84echo " - Solr API accessed internally via: http://$SOLR_HOST:$SOLR_PORT/solr/"
85
86
87#if [ "$first_time" = "1" ] ; then
88# echo "++Solr will run off the tomcat server on port $SOLR_PORT. "
89# echo "-- This port value can be changed by editing tomcat.port in build.properties"
90# echo ""
91#fi
Note: See TracBrowser for help on using the repository browser.