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

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

Some echo fine-tuning

File size: 3.1 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
34## If using jetty:
35## The port Jetty runs on:
36#SOLR_JETTY_PORT=8983
37
38## The port Jetty listens on for a "stop" command
39#JETTY_STOP_PORT=8079
40
41
42if test -z $GSDLOS ; then
43 GSDLOS=`uname -s | tr '[A-Z]' '[a-z]'`
44 # check for running bash under Cygwin
45 if test "`echo $GSDLOS | sed 's/cygwin//'`" != "$GSDLOS" ;
46 then
47 GSDLOS=windows
48 fi
49 # check for running bash under MinGW/MSys
50 if test "`echo $GSDLOS | sed 's/mingw//'`" != "$GSDLOS" ;
51 then
52 GSDLOS=windows
53 fi
54 echo "GSDLOS was not set. Setting it to '$GSDLOS'"
55 export GSDLOS
56fi
57
58#first_time=0;
59
60if [ "x$GEXT_SOLR" = "x" ] ; then
61 echo "+ Setting up your environment for $extdesc ..."
62 export GEXT_SOLR=`pwd`
63
64 if [ -d "$GEXT_SOLR/bin/script" ] ; then
65 export PATH=$GEXT_SOLR/bin/script:$PATH
66 fi
67
68 if [ -d "$GEXT_SOLR/lib" ] ; then
69 if [ "$GSDLOS" = "linux" ] ; then
70 export LD_LIBRARY_PATH=$GEXT_SOLR/lib:$LD_LIBRARY_PATH
71 elif [ "$GSDLOS" = "darwin" ] ; then
72 export DYLD_LIBRARY_PATH=$GEXT_SOLR/lib:$DYLD_LIBRARY_PATH
73 fi
74 fi
75
76 extdir=${GEXT_SOLR##*/}
77
78 if [ "x$GSDL3EXTS" = "x" ] ; then
79 export GSDL3EXTS=$extdir
80 else
81 export GSDL3EXTS=$GSDL3EXTS:$extdir
82 fi
83
84# export SOLR_JETTY_PORT
85# export JETTY_STOP_PORT
86 export SOLR_PORT
87 export SOLR_HOST
88# first_time=1
89
90 echo "+ ... Your environment is now setup for $extdesc"
91else
92 echo "+ Your environment is already setup for $extdesc"
93fi
94
95#echo "SOLR port: $SOLR_PORT"
96#echo "SOLR host: $SOLR_HOST"
97echo " - Solr API accessed internally via: http://$SOLR_HOST:$SOLR_PORT/solr/"
98
99
100#echo "++Solr/Jetty server will run on port $SOLR_JETTY_PORT (+ port $JETTY_STOP_PORT for shutdown command)"
101
102#if [ "$first_time" = "1" ] ; then
103# echo "++Solr will run off the tomcat server on port $SOLR_PORT. "
104# echo "-- This port value can be changed by editing tomcat.port in build.properties"
105# echo ""
106#fi
Note: See TracBrowser for help on using the repository browser.