#!/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 determining whether Apache is installed with mod_proxy_ajp
# support.
#
########################################################################


# Determine if Apache is intalled with mod_proxy_ajp support
APACHE_SYSCONFIG_FILE_PATH=/etc/sysconfig/apache2
if [ -f $APACHE_SYSCONFIG_FILE_PATH ]; then
   echo "Apache installed"
   # Check if the mod_proxy_ajp module is configured to be loaded
   TEST_PROXY_AJP=$(grep -i proxy_ajp $APACHE_SYSCONFIG_FILE_PATH | cut -c1-14 | grep -i APACHE_MODULES)
   if [ -z "${TEST_PROXY_AJP}" ]; then
      echo "mod_proxy_ajp not configured to be loaded"
      retVal=0
   else
      echo "mod_proxy_ajp configured to be loaded"
      retVal=1
   fi
else
   echo "Apache not installed"
   retVal=0
fi

exit $retVal