Blame SOURCES/hsqldb-post

100e1c
#!/bin/sh
100e1c
100e1c
# This file was created with portions of the original SysV init script shipped 
100e1c
# with hsqldb
100e1c
100e1c
# Copyright (c) 2001-2004, The HSQL Development Group
100e1c
# All rights reserved.
100e1c
#
100e1c
# Redistribution and use in source and binary forms, with or without
100e1c
# modification, are permitted provided that the following conditions are met:
100e1c
#
100e1c
# Redistributions of source code must retain the above copyright notice, this
100e1c
# list of conditions and the following disclaimer.
100e1c
#
100e1c
# Redistributions in binary form must reproduce the above copyright notice,
100e1c
# this list of conditions and the following disclaimer in the documentation
100e1c
# and/or other materials provided with the distribution.
100e1c
#
100e1c
# Neither the name of the HSQL Development Group nor the names of its
100e1c
# contributors may be used to endorse or promote products derived from this
100e1c
# software without specific prior written permission.
100e1c
#
100e1c
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
100e1c
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
100e1c
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
100e1c
# ARE DISCLAIMED. IN NO EVENT SHALL HSQL DEVELOPMENT GROUP, HSQLDB.ORG,
100e1c
# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
100e1c
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
100e1c
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
100e1c
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
100e1c
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
100e1c
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
100e1c
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
100e1c
100e1c
100e1c
# $MAX_START_SECS from when the Server/WebServer is started.
100e1c
MAX_START_SECS=60
100e1c
100e1c
# Class in the org.hsqldb package to start.
100e1c
# At this time, only the values "Server" or "WebServer" will work.
100e1c
TARGET_CLASS=Server
100e1c
100e1c
. /etc/sysconfig/hsqldb
100e1c
100e1c
# PROPERTY_FILE is a derived value.
100e1c
case "$TARGET_CLASS" in
100e1c
    Server) PROPERTY_FILE="$SERVER_HOME"/server.properties;;
100e1c
    WebServer) PROPERTY_FILE="$SERVER_HOME"/webserver.properties;;
100e1c
    *)
100e1c
        echo 'Unsupported value for $TARGET_CLASS:  '"$TARGET_CLASS" 1>&2
100e1c
        exit 2;;
100e1c
esac
100e1c
[ -f "$PROPERTY_FILE" ] || {
100e1c
    echo "'$PROPERTY_FILE' is missing" 1>&2
100e1c
    exit 2
100e1c
}
100e1c
[ -r "$PROPERTY_FILE" ] || {
100e1c
    echo "'$PROPERTY_FILE' isn't readable" 1>&2
100e1c
    exit 2
100e1c
}
100e1c
100e1c
AUTH_FILE_SWITCH=
100e1c
# N.b., there will be a problem if there are special characters or
100e1c
# spaces inside of $AUTH_FILE.
100e1c
[ -n "$AUTH_FILE" ] && AUTH_FILE_SWITCH="-Dsqltoolsprayer.rcfile=$AUTH_FILE"
100e1c
100e1c
# Might as well set CLASSPATH for a cleaner command.
100e1c
CLASSPATH="$HSQLDB_JAR_PATH"
100e1c
export CLASSPATH
100e1c
100e1c
sleep 1
100e1c
100e1c
"$JAVA_EXECUTABLE" $AUTH_FILE_SWITCH $CLIENT_JVMARGS \
100e1c
    "-Dsqltoolsprayer.propfile=$PROPERTY_FILE" \
100e1c
    "-Dsqltoolsprayer.maxtime=${MAX_START_SECS}000" \
100e1c
    org.hsqldb.util.SqlToolSprayer '--;'