[26192] | 1 | #!/bin/bash
|
---|
| 2 | #
|
---|
| 3 | # Terrier - Terabyte Retriever
|
---|
| 4 | # Webpage: http://terrier.org
|
---|
| 5 | # Contact: [email protected]
|
---|
| 6 | #
|
---|
| 7 | # The contents of this file are subject to the Mozilla Public
|
---|
| 8 | # License Version 1.1 (the "License"); you may not use this file
|
---|
| 9 | # except in compliance with the License. You may obtain a copy of
|
---|
| 10 | # the License at http://www.mozilla.org/MPL/
|
---|
| 11 | #
|
---|
| 12 | # Software distributed under the License is distributed on an "AS
|
---|
| 13 | # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
---|
| 14 | # implied. See the License for the specific language governing
|
---|
| 15 | # rights and limitations under the License.
|
---|
| 16 | #
|
---|
| 17 | # The Original Code is http_server.sh
|
---|
| 18 | #
|
---|
| 19 | # The Initial Developer of the Original Code is the University of Glasgow.
|
---|
| 20 | # Portions created by The Initial Developer are Copyright (C) 2004-2011
|
---|
| 21 | # the initial Developer. All Rights Reserved.
|
---|
| 22 | #
|
---|
| 23 | # Contributor(s):
|
---|
| 24 | # Vassilis Plachouras <[email protected]> (original author)
|
---|
| 25 | # Craig Macdonald <[email protected]>
|
---|
| 26 | #
|
---|
| 27 | # a script for starting a Jetty webserver, for retrieval results
|
---|
| 28 | # by default, port 8080
|
---|
| 29 |
|
---|
| 30 | fullPath () {
|
---|
| 31 | t='TEMP=`cd $TEMP; pwd`'
|
---|
| 32 | for d in $*; do
|
---|
| 33 | eval `echo $t | sed 's/TEMP/'$d'/g'`
|
---|
| 34 | done
|
---|
| 35 | }
|
---|
| 36 |
|
---|
| 37 | TERRIER_BIN=`dirname $0`
|
---|
| 38 | if [ -e "$TERRIER_BIN/terrier-env.sh" ];
|
---|
| 39 | then
|
---|
| 40 | . $TERRIER_BIN/terrier-env.sh
|
---|
| 41 | fi
|
---|
| 42 |
|
---|
| 43 | #setup TERRIER_HOME
|
---|
| 44 | if [ ! -n "$TERRIER_HOME" ]
|
---|
| 45 | then
|
---|
| 46 | #find out where this script is running
|
---|
| 47 | TEMPVAR=`dirname $0`
|
---|
| 48 | #make the path abolute
|
---|
| 49 | fullPath TEMPVAR
|
---|
| 50 | #terrier folder is folder above
|
---|
| 51 | TERRIER_HOME=`dirname $TEMPVAR`
|
---|
| 52 | #echo "Setting TERRIER_HOME to $TERRIER_HOME"
|
---|
| 53 | fi
|
---|
| 54 |
|
---|
| 55 | if [ -z "$TERRIER_LIB" ];
|
---|
| 56 | then
|
---|
| 57 | TERRIER_LIB=$TERRIER_HOME/lib/
|
---|
| 58 | fi
|
---|
| 59 |
|
---|
| 60 | for f in $TERRIER_LIB/jetty-ext/*.jar;
|
---|
| 61 | do
|
---|
| 62 | if [ -z "$CLASSPATH" ]
|
---|
| 63 | then
|
---|
| 64 | CLASSPATH=$f
|
---|
| 65 | else
|
---|
| 66 | CLASSPATH=$CLASSPATH:$f
|
---|
| 67 | fi
|
---|
| 68 | done
|
---|
| 69 |
|
---|
| 70 | export CLASSPATH
|
---|
| 71 |
|
---|
| 72 | if [ "$#" == "0" ];
|
---|
| 73 | then
|
---|
| 74 | $TERRIER_HOME/bin/anyclass.sh -Dorg.mortbay.util.FileResource.checkAliases=false org.terrier.utility.SimpleJettyHTTPServer 8080 $TERRIER_HOME/src/webapps/simple/
|
---|
| 75 | else
|
---|
| 76 | $TERRIER_HOME/bin/anyclass.sh -Dorg.mortbay.util.FileResource.checkAliases=false org.terrier.utility.SimpleJettyHTTPServer $*
|
---|
| 77 | fi
|
---|