source: trunk/dports/java/tomcat5/files/conf_setup.sh @ 72252

Last change on this file since 72252 was 13664, checked in by jberry, 15 years ago

Revisions to tomcat5 to make it possible to run it under JDK 5.0

  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 1.2 KB
Line 
1#!/bin/sh
2#
3# conf_setup.sh
4#
5# This file performs a self-repair sanity check on the tomcat configuration files.
6# Any critical files that are missing will be replaced by sample files. This is
7# particularly useful in first-run situations.
8#
9# Note that no effort is made to ensure the validity of file contents.
10#
11
12PRG=`basename $0`
13
14# Look for $CATALINA_BASE
15if [ -z "$CATALINA_BASE" -o ! -d "$CATALINA_BASE" ]; then
16        echo "$PRG: CATALINA_BASE must be set in my environment"
17        exit 1
18fi
19
20# Look for $CATALINA_BASE/conf
21CONF="${CATALINA_BASE}/conf"
22if [ ! -d "${CONF}" ]; then
23        echo "$PRG: ${CONF} directory not found!"
24        exit 1
25fi
26
27CONF_FILES=" \
28        conf/catalina.policy \
29        conf/catalina.properties \
30        conf/server.xml \
31        conf/tomcat-users.xml \
32        conf/web.xml \
33        conf/setenv.local \
34        "
35
36# Try to repair any needed files in conf
37for FILE in $CONF_FILES; do
38        SAMPLE="${FILE}.sample"
39        if [ ! -f "${CATALINA_BASE}/${FILE}" ]; then
40                if [ ! -f "${CATALINA_BASE}/${SAMPLE}" ]; then
41                        echo "$PRG: file ${FILE} is missing, but no corresponding ${SAMPLE} file was found to repair it!"
42                else
43                        echo "$PRG: file ${FILE} is missing; copying ${SAMPLE} to its place."
44                        cp -p "${CATALINA_BASE}/${SAMPLE}" "${CATALINA_BASE}/${FILE}"
45                fi
46        fi
47done
Note: See TracBrowser for help on using the repository browser.