blob: 696f661b3a60ba1b16962df0661b3a6a45fd6ad4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
|
#!/bin/sh
#
# --- BEGIN COPYRIGHT BLOCK ---
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Copyright (C) 2007 Red Hat, Inc.
# All rights reserved.
# --- END COPYRIGHT BLOCK ---
#
# Read default PKI configuration.
. /usr/share/pki/etc/pki.conf
# Read user-defined PKI configuration.
. /etc/pki/pki.conf
# Check to insure that this script's original invocation directory
# has not been deleted!
CWD=`/bin/pwd > /dev/null 2>&1`
if [ $? -ne 0 ] ; then
echo "Cannot invoke '$0' from non-existent directory!"
exit 255
fi
###############################################################################
## (1) Specify variables used by this script. ##
###############################################################################
PRODUCT=@PKI_PRODUCT@
COMMAND=@PKI_COMMAND@
###############################################################################
## (2) Check for valid usage of this command wrapper. ##
###############################################################################
###############################################################################
## (3) Define helper functions. ##
###############################################################################
invalid_operating_system() {
echo
echo "ERROR: '$0' does not execute on the '$1' operating system!"
echo
}
invalid_architecture() {
echo
echo "ERROR: '$0' does not execute on the '$1' architecture!"
echo
}
###############################################################################
## (4) Set the LD_LIBRARY_PATH environment variable to determine the ##
## search order this command wrapper uses to find shared libraries. ##
###############################################################################
OS=`uname -s`
if [ "${OS}" = "Linux" ] ; then
ARCHITECTURE=`arch`
JAVA="${JAVA_HOME}/bin/java"
JAVA_OPTIONS=""
elif [ "${OS}" = "SunOS" ] ; then
ARCHITECTURE=`uname -p`
if [ "${ARCHITECTURE}" = "sparc" ] &&
[ -d "/usr/lib/sparcv9/" ] ; then
ARCHITECTURE="sparcv9"
fi
if [ "${ARCHITECTURE}" = "sparc" ] ; then
JAVA="/usr/jdk/instances/jdk1.5.0/jre/bin/java"
JAVA_OPTIONS=""
LD_LIBRARY_PATH=/usr/lib:/lib
LD_LIBRARY_PATH=/usr/lib/dirsec:${LD_LIBRARY_PATH}
LD_LIBRARY_PATH=/usr/lib/${PRODUCT}:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH
elif [ "${ARCHITECTURE}" = "sparcv9" ] ; then
JAVA="/usr/jdk/instances/jdk1.5.0/jre/bin/java"
JAVA_OPTIONS="-d64"
LD_LIBRARY_PATH=/usr/lib:/lib
LD_LIBRARY_PATH=/usr/lib/dirsec:${LD_LIBRARY_PATH}
LD_LIBRARY_PATH=/usr/lib/${PRODUCT}:${LD_LIBRARY_PATH}
LD_LIBRARY_PATH=/usr/lib/sparcv9:/lib/sparcv9:${LD_LIBRARY_PATH}
LD_LIBRARY_PATH=/usr/lib/sparcv9/dirsec:${LD_LIBRARY_PATH}
LD_LIBRARY_PATH=/usr/lib/sparcv9/${PRODUCT}:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH
else
invalid_architecture "${ARCHITECTURE}"
exit 255
fi
else
invalid_operating_system "${OS}"
exit 255
fi
###############################################################################
## (5) Execute the java command specified by this java command wrapper ##
## based upon the LD_LIBRARY_PATH and PKI_LIB environment variables. ##
###############################################################################
${JAVA} ${JAVA_OPTIONS} \
-Djava.ext.dirs=${PKI_LIB} \
-Djava.util.logging.config.file=${LOGGING_CONFIG} \
com.netscape.cmstools.${COMMAND} "$@"
exit $?
|