blob: 7aa0c4041c619b485d229ba093a2f846d75f80b0 [file] [log] [blame]
Cheng Tang697ce242014-04-27 16:18:17 +08001#!/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# Script to digest password using the algorithm specified
20#
21# $Id: digest.sh 1202062 2011-11-15 06:50:02Z mturk $
22# -----------------------------------------------------------------------------
23
24# Better OS/400 detection: see Bugzilla 31132
25os400=false
26case "`uname`" in
27OS400*) os400=true;;
28esac
29
30# resolve links - $0 may be a softlink
31PRG="$0"
32
33while [ -h "$PRG" ] ; do
34 ls=`ls -ld "$PRG"`
35 link=`expr "$ls" : '.*-> \(.*\)$'`
36 if expr "$link" : '/.*' > /dev/null; then
37 PRG="$link"
38 else
39 PRG=`dirname "$PRG"`/"$link"
40 fi
41done
42
43PRGDIR=`dirname "$PRG"`
44EXECUTABLE=tool-wrapper.sh
45
46# Check that target executable exists
47if $os400; then
48 # -x will Only work on the os400 if the files are:
49 # 1. owned by the user
50 # 2. owned by the PRIMARY group of the user
51 # this will not work if the user belongs in secondary groups
52 eval
53else
54 if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
55 echo "Cannot find $PRGDIR/$EXECUTABLE"
56 echo "The file is absent or does not have execute permission"
57 echo "This file is needed to run this program"
58 exit 1
59 fi
60fi
61
62exec "$PRGDIR"/"$EXECUTABLE" -server org.apache.catalina.realm.RealmBase "$@"