[24446] | 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 |
|
---|
[29711] | 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=8983
|
---|
| 18 | SOLR_HOST=localhost
|
---|
| 19 | file=$GSDL3SRCHOME/build.properties
|
---|
| 20 | while IFS== read propname propval; do
|
---|
| 21 | if [ "x$propname" = "xtomcat.server" ] ; then
|
---|
| 22 | SOLR_HOST=$propval
|
---|
| 23 | fi
|
---|
| 24 | if [ "x$propname" = "xtomcat.port" ] ; then
|
---|
| 25 | SOLR_PORT=$propval
|
---|
| 26 | fi
|
---|
| 27 | done < $file
|
---|
| 28 |
|
---|
[31138] | 29 | echo "SOLR port: $SOLR_PORT"
|
---|
| 30 | echo "SOLR host: $SOLR_HOST"
|
---|
[29711] | 31 |
|
---|
| 32 | # If using jetty:
|
---|
[24446] | 33 | # The port Jetty runs on:
|
---|
| 34 | SOLR_JETTY_PORT=8983
|
---|
| 35 |
|
---|
| 36 | # The port Jetty listens on for a "stop" command
|
---|
| 37 | JETTY_STOP_PORT=8079
|
---|
| 38 |
|
---|
| 39 |
|
---|
| 40 | if test -z $GSDLOS ; then
|
---|
| 41 | GSDLOS=`uname -s | tr '[A-Z]' '[a-z]'`
|
---|
| 42 | # check for running bash under Cygwin
|
---|
| 43 | if test "`echo $GSDLOS | sed 's/cygwin//'`" != "$GSDLOS" ;
|
---|
| 44 | then
|
---|
| 45 | GSDLOS=windows
|
---|
| 46 | fi
|
---|
| 47 | # check for running bash under MinGW/MSys
|
---|
| 48 | if test "`echo $GSDLOS | sed 's/mingw//'`" != "$GSDLOS" ;
|
---|
| 49 | then
|
---|
| 50 | GSDLOS=windows
|
---|
| 51 | fi
|
---|
| 52 | echo "GSDLOS was not set. Setting it to '$GSDLOS'"
|
---|
| 53 | export GSDLOS
|
---|
| 54 | fi
|
---|
| 55 |
|
---|
| 56 | first_time=0;
|
---|
| 57 |
|
---|
| 58 | if [ "x$GEXT_SOLR" = "x" ] ; then
|
---|
| 59 | export GEXT_SOLR=`pwd`
|
---|
| 60 |
|
---|
| 61 | if [ -d "$GEXT_SOLR/bin/script" ] ; then
|
---|
| 62 | export PATH=$GEXT_SOLR/bin/script:$PATH
|
---|
| 63 | fi
|
---|
| 64 |
|
---|
| 65 | if [ -d "$GEXT_SOLR/lib" ] ; then
|
---|
| 66 | if [ "$GSDLOS" = "linux" ] ; then
|
---|
| 67 | export LD_LIBRARY_PATH=$GEXT_SOLR/lib:$LD_LIBRARY_PATH
|
---|
| 68 | elif [ "$GSDLOS" = "darwin" ] ; then
|
---|
| 69 | export DYLD_LIBRARY_PATH=$GEXT_SOLR/lib:$DYLD_LIBRARY_PATH
|
---|
| 70 | fi
|
---|
| 71 | fi
|
---|
| 72 |
|
---|
| 73 | extdir=${GEXT_SOLR##*/}
|
---|
| 74 |
|
---|
[24485] | 75 | if [ "x$GSDL3EXTS" = "x" ] ; then
|
---|
| 76 | export GSDL3EXTS=$extdir
|
---|
[24446] | 77 | else
|
---|
[24485] | 78 | export GSDL3EXTS=$GSDL3EXTS:$extdir
|
---|
[24446] | 79 | fi
|
---|
| 80 |
|
---|
| 81 | export SOLR_JETTY_PORT
|
---|
| 82 | export JETTY_STOP_PORT
|
---|
[29711] | 83 | export SOLR_PORT
|
---|
| 84 | export SOLR_HOST
|
---|
[24446] | 85 | first_time=1
|
---|
| 86 |
|
---|
| 87 | echo "+Your environment is now setup for $extdesc"
|
---|
| 88 | else
|
---|
| 89 | echo "+Your environment is already setup for $extdesc"
|
---|
| 90 | fi
|
---|
| 91 |
|
---|
[31138] | 92 | #echo "++Solr/Jetty server will run on port $SOLR_JETTY_PORT (+ port $JETTY_STOP_PORT for shutdown command)"
|
---|
[24446] | 93 |
|
---|
| 94 | if [ "$first_time" = "1" ] ; then
|
---|
[31138] | 95 | echo "++Solr will run off the tomcat server on port $SOLR_PORT. "
|
---|
| 96 | echo "-- This port value can be changed by editing tomcat.port in build.properties"
|
---|
| 97 | echo ""
|
---|
[24446] | 98 | fi
|
---|