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 | # $Id: startup.sh 562770 2007-08-04 22:13:58Z markt $ |
---|
22 | # ----------------------------------------------------------------------------- |
---|
23 | |
---|
24 | # Better OS/400 detection: see Bugzilla 31132 |
---|
25 | os400=false |
---|
26 | darwin=false |
---|
27 | case "`uname`" in |
---|
28 | CYGWIN*) cygwin=true;; |
---|
29 | OS400*) os400=true;; |
---|
30 | Darwin*) darwin=true;; |
---|
31 | esac |
---|
32 | |
---|
33 | # resolve links - $0 may be a softlink |
---|
34 | PRG="$0" |
---|
35 | |
---|
36 | while [ -h "$PRG" ] ; do |
---|
37 | ls=`ls -ld "$PRG"` |
---|
38 | link=`expr "$ls" : '.*-> \(.*\)$'` |
---|
39 | if expr "$link" : '/.*' > /dev/null; then |
---|
40 | PRG="$link" |
---|
41 | else |
---|
42 | PRG=`dirname "$PRG"`/"$link" |
---|
43 | fi |
---|
44 | done |
---|
45 | |
---|
46 | PRGDIR=`dirname "$PRG"` |
---|
47 | EXECUTABLE=catalina.sh |
---|
48 | |
---|
49 | # Check that target executable exists |
---|
50 | if $os400; then |
---|
51 | # -x will Only work on the os400 if the files are: |
---|
52 | # 1. owned by the user |
---|
53 | # 2. owned by the PRIMARY group of the user |
---|
54 | # this will not work if the user belongs in secondary groups |
---|
55 | eval |
---|
56 | else |
---|
57 | if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then |
---|
58 | echo "Cannot find $PRGDIR/$EXECUTABLE" |
---|
59 | echo "This file is needed to run this program" |
---|
60 | exit 1 |
---|
61 | fi |
---|
62 | fi |
---|
63 | |
---|
64 | exec "$PRGDIR"/"$EXECUTABLE" start "$@" |
---|