1 |
|
---|
2 | extdesc="the Solr Extension"
|
---|
3 |
|
---|
4 | full_setup=`pwd`/${BASH_SOURCE}
|
---|
5 | fulldir=${full_setup%/*}
|
---|
6 | fulldir=${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
|
---|
17 | SOLR_PORT=8383
|
---|
18 | SOLR_HOST=127.0.0.1
|
---|
19 | file=$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
|
---|
24 | while 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
|
---|
31 | done < $file
|
---|
32 |
|
---|
33 |
|
---|
34 | if 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
|
---|
48 | fi
|
---|
49 |
|
---|
50 | #first_time=0;
|
---|
51 |
|
---|
52 | if [ "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"
|
---|
80 | else
|
---|
81 | echo "+Your environment is already setup for $extdesc"
|
---|
82 | fi
|
---|
83 |
|
---|
84 | echo " - 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
|
---|