2007-04-20 23:45:29 +02:00
|
|
|
#!/bin/sh
|
|
|
|
########################################################################
|
|
|
|
#
|
|
|
|
# Copyright (C) 2006 Novell, Inc. All Rights Reserved.
|
|
|
|
#
|
|
|
|
# This library is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU Lesser General Public
|
|
|
|
# License as published by the Free Software Foundation; version 2.1
|
|
|
|
# of the License.
|
|
|
|
#
|
|
|
|
# This library 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
|
|
|
|
# Library Lesser General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU Lesser General Public
|
|
|
|
# License along with this library; if not, Novell, Inc.
|
|
|
|
#
|
|
|
|
# To contact Novell about this file by physical or electronic mail,
|
|
|
|
# you may find current contact information at www.novell.com.
|
|
|
|
#
|
|
|
|
# Author: Juan Carlos Luciani <jluciani@novell.com>
|
|
|
|
#
|
|
|
|
########################################################################
|
|
|
|
|
|
|
|
########################################################################
|
|
|
|
#
|
|
|
|
# Script for editing svc.settings files
|
|
|
|
#
|
|
|
|
########################################################################
|
|
|
|
|
|
|
|
# Source our environment variables file
|
|
|
|
. /etc/CASA/authtoken/svc/envvars
|
|
|
|
|
2008-07-17 19:35:59 +02:00
|
|
|
TEST_IBM_JVM=$($JAVA_HOME/bin/java -version 2>&1 | grep -i ibm)
|
|
|
|
|
2007-06-23 00:12:20 +02:00
|
|
|
# Check if we need to determine which server.xml file to use
|
|
|
|
if [ -f /srv/www/casaats/conf/server.xml ]; then
|
|
|
|
# No need to determine which file to use
|
|
|
|
SERVER_XML_FILE_PATH=/srv/www/casaats/conf/server.xml
|
|
|
|
else
|
|
|
|
# Determine which server.xml file to use
|
|
|
|
if [ -z "${TEST_IBM_JVM}" ]; then
|
|
|
|
# Assume Sun JVM
|
|
|
|
# Use PKCS12 version if PKCS12 store exists
|
|
|
|
if [ -f /etc/ssl/servercerts/keystore.p12 ]; then
|
|
|
|
SERVER_XML_FILE_PATH=/srv/www/casaats/conf/server-pkcs12-sun.xml
|
|
|
|
else
|
|
|
|
SERVER_XML_FILE_PATH=/srv/www/casaats/conf/server-sun.xml
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
# IBM JVM
|
|
|
|
# Use PKCS12 version if PKCS12 store exists
|
|
|
|
if [ -f /etc/ssl/servercerts/keystore.p12 ]; then
|
|
|
|
SERVER_XML_FILE_PATH=/srv/www/casaats/conf/server-pkcs12-ibm.xml
|
|
|
|
else
|
|
|
|
SERVER_XML_FILE_PATH=/srv/www/casaats/conf/server-ibm.xml
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "server.xml path = "$SERVER_XML_FILE_PATH
|
|
|
|
|
|
|
|
|
|
|
|
SSL_CONNECTOR_BEGIN="<!-- SSL_CONNECTOR_BEGIN -->"
|
|
|
|
SSL_CONNECTOR_END="<!-- SSL_CONNECTOR_END -->"
|
|
|
|
SSL_CONNECTOR_COMMENT_BEGIN="<!-- SSL_CONNECTOR_COMMENT_BEGIN"
|
|
|
|
SSL_CONNECTOR_COMMENT_END="SSL_CONNECTOR_COMMENT_END -->"
|
|
|
|
AJP_CONNECTOR_BEGIN="<!-- AJP_CONNECTOR_BEGIN -->"
|
|
|
|
AJP_CONNECTOR_END="<!-- AJP_CONNECTOR_END -->"
|
|
|
|
AJP_CONNECTOR_COMMENT_BEGIN="<!-- AJP_CONNECTOR_COMMENT_BEGIN"
|
|
|
|
AJP_CONNECTOR_COMMENT_END="AJP_CONNECTOR_COMMENT_END -->"
|
|
|
|
|
|
|
|
|
2007-06-25 18:39:33 +02:00
|
|
|
# Assume success
|
|
|
|
retVal=0
|
|
|
|
|
2007-04-20 23:45:29 +02:00
|
|
|
# Perform the operation requested
|
2007-06-23 00:12:20 +02:00
|
|
|
if [ $# -eq 2 ]; then
|
|
|
|
if [ $1 = "-e" ]; then
|
|
|
|
if [ $2 = "ssl" ]; then
|
|
|
|
echo "Enabling ssl connector"
|
2007-06-25 18:39:33 +02:00
|
|
|
sed -i s:"$SSL_CONNECTOR_COMMENT_BEGIN":"$SSL_CONNECTOR_BEGIN":g $SERVER_XML_FILE_PATH
|
|
|
|
sed -i s:"$SSL_CONNECTOR_COMMENT_END":"$SSL_CONNECTOR_END":g $SERVER_XML_FILE_PATH
|
2007-06-23 00:12:20 +02:00
|
|
|
else
|
|
|
|
if [ $2 = "ajp" ]; then
|
|
|
|
echo "Enabling ajp connector"
|
2007-06-25 18:39:33 +02:00
|
|
|
sed -i s:"$AJP_CONNECTOR_COMMENT_BEGIN":"$AJP_CONNECTOR_BEGIN":g $SERVER_XML_FILE_PATH
|
|
|
|
sed -i s:"$AJP_CONNECTOR_COMMENT_END":"$AJP_CONNECTOR_END":g $SERVER_XML_FILE_PATH
|
|
|
|
ln -s /etc/CASA/authtoken/svc/casaats.conf /etc/apache2/conf.d/casaats.conf
|
2007-06-23 00:12:20 +02:00
|
|
|
else
|
|
|
|
echo "Connector type not supported"
|
2007-06-25 18:39:33 +02:00
|
|
|
retVal=1
|
2007-06-23 00:12:20 +02:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
if [ $1 = "-d" ]; then
|
|
|
|
if [ $2 = "ssl" ]; then
|
|
|
|
echo "Disabling ssl connector"
|
2007-06-25 18:39:33 +02:00
|
|
|
sed -i s:"$SSL_CONNECTOR_BEGIN":"$SSL_CONNECTOR_COMMENT_BEGIN":g $SERVER_XML_FILE_PATH
|
|
|
|
sed -i s:"$SSL_CONNECTOR_END":"$SSL_CONNECTOR_COMMENT_END":g $SERVER_XML_FILE_PATH
|
|
|
|
rm -f /etc/apache2/conf.d/casaats.conf
|
2007-06-23 00:12:20 +02:00
|
|
|
else
|
|
|
|
if [ $2 = "ajp" ]; then
|
|
|
|
echo "Disabling ajp connector"
|
2007-06-25 18:39:33 +02:00
|
|
|
sed -i s:"$AJP_CONNECTOR_BEGIN":"$AJP_CONNECTOR_COMMENT_BEGIN":g $SERVER_XML_FILE_PATH
|
|
|
|
sed -i s:"$AJP_CONNECTOR_END":"$AJP_CONNECTOR_COMMENT_END":g $SERVER_XML_FILE_PATH
|
2007-06-23 00:12:20 +02:00
|
|
|
else
|
|
|
|
echo "Connector type not supported"
|
2007-06-25 18:39:33 +02:00
|
|
|
retVal=1
|
2007-06-23 00:12:20 +02:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
else
|
2007-06-25 18:39:33 +02:00
|
|
|
if [ $1 = "-s" ]; then
|
|
|
|
if [ $2 = "ssl" ]; then
|
|
|
|
echo "Checking ssl connector status"
|
|
|
|
TEST_SSL_CONNECTOR=$(grep "$SSL_CONNECTOR_BEGIN" $SERVER_XML_FILE_PATH)
|
|
|
|
if [ -z "${TEST_SSL_CONNECTOR}" ]; then
|
|
|
|
echo "Connector disabled"
|
|
|
|
else
|
|
|
|
echo "Connector enabled"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
if [ $2 = "ajp" ]; then
|
|
|
|
echo "Checking ajp connector status"
|
|
|
|
TEST_AJP_CONNECTOR=$(grep "$AJP_CONNECTOR_BEGIN" $SERVER_XML_FILE_PATH)
|
|
|
|
if [ -z "${TEST_AJP_CONNECTOR}" ]; then
|
|
|
|
echo "Connector disabled"
|
|
|
|
else
|
|
|
|
echo "Connector enabled"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "Connector type not supported"
|
|
|
|
retVal=1
|
|
|
|
fi
|
|
|
|
fi
|
2007-06-23 00:12:20 +02:00
|
|
|
else
|
2007-06-25 18:39:33 +02:00
|
|
|
if [ $1 = "-file" ]; then
|
|
|
|
echo "Process properties file"
|
2008-07-17 19:35:59 +02:00
|
|
|
# Proceed based on the JVM that we are utilizing
|
|
|
|
if [ -z "${TEST_IBM_JVM}" ]; then
|
|
|
|
# Assuming the Sun JVM in which case we need to load the xerces-j2 jar at boot time to avoid load class errors.
|
|
|
|
$JAVA_HOME/bin/java -Xbootclasspath/a:/usr/share/java/xerces-j2.jar -jar /usr/share/java/CASA/authtoken/bin/CasaTomcatConnectorEditor.jar $*
|
|
|
|
else
|
|
|
|
$JAVA_HOME/bin/java -jar /usr/share/java/CASA/authtoken/bin/CasaTomcatConnectorEditor.jar $*
|
|
|
|
fi
|
2007-06-25 18:39:33 +02:00
|
|
|
else
|
|
|
|
echo "Invalid operation requested"
|
|
|
|
retVal=1
|
|
|
|
fi
|
|
|
|
fi
|
2007-06-23 00:12:20 +02:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "Invalid number of parameters"
|
2007-06-25 18:39:33 +02:00
|
|
|
retVal=1
|
2007-06-23 00:12:20 +02:00
|
|
|
fi
|
2007-04-20 23:45:29 +02:00
|
|
|
|