"Fossies" - the Fresh Open Source Software Archive

Member "apache-tomcat-8.5.58/bin/startup.sh" (10 Sep 2020, 1904 Bytes) of package /windows/www/apache-tomcat-8.5.58-windows-x64.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/sh
    2 
    3 # Licensed to the Apache Software Foundation (ASF) under one or more
    4 # contributor license agreements.  See the NOTICE file distributed with
    5 # this work for additional information regarding copyright ownership.
    6 # The ASF licenses this file to You under the Apache License, Version 2.0
    7 # (the "License"); you may not use this file except in compliance with
    8 # the License.  You may obtain a copy of the License at
    9 #
   10 #     http://www.apache.org/licenses/LICENSE-2.0
   11 #
   12 # Unless required by applicable law or agreed to in writing, software
   13 # distributed under the License is distributed on an "AS IS" BASIS,
   14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   15 # See the License for the specific language governing permissions and
   16 # limitations under the License.
   17 
   18 # -----------------------------------------------------------------------------
   19 # Start Script for the CATALINA Server
   20 # -----------------------------------------------------------------------------
   21 
   22 # Better OS/400 detection: see Bugzilla 31132
   23 os400=false
   24 case "`uname`" in
   25 OS400*) os400=true;;
   26 esac
   27 
   28 # resolve links - $0 may be a softlink
   29 PRG="$0"
   30 
   31 while [ -h "$PRG" ] ; do
   32   ls=`ls -ld "$PRG"`
   33   link=`expr "$ls" : '.*-> \(.*\)$'`
   34   if expr "$link" : '/.*' > /dev/null; then
   35     PRG="$link"
   36   else
   37     PRG=`dirname "$PRG"`/"$link"
   38   fi
   39 done
   40 
   41 PRGDIR=`dirname "$PRG"`
   42 EXECUTABLE=catalina.sh
   43 
   44 # Check that target executable exists
   45 if $os400; then
   46   # -x will Only work on the os400 if the files are:
   47   # 1. owned by the user
   48   # 2. owned by the PRIMARY group of the user
   49   # this will not work if the user belongs in secondary groups
   50   eval
   51 else
   52   if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
   53     echo "Cannot find $PRGDIR/$EXECUTABLE"
   54     echo "The file is absent or does not have execute permission"
   55     echo "This file is needed to run this program"
   56     exit 1
   57   fi
   58 fi
   59 
   60 exec "$PRGDIR"/"$EXECUTABLE" start "$@"