#!/bin/sh

# Shell script to collect data concerning Websphere.
# Copyright (C) 2008-2009 QNH.
#
# 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; either version 2, or (at your option)
# any later version.
#
# 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; see the file COPYING.
# If not, write to the Free Software Foundation,
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# Contact information: http://scc.qnh-infrastructure.nl/index.html 

# This is a system module of scc, to call it separately in the
# proper environment, use: scc-collect -i -e <module_name>

# SCC-release:	1.9.28
# file-version:	$Revision: 1.4 $
 
set -u

. ${SCC_BIN}/scc_modules/scc_utils

# Handle WAS: WebSphere Application Server
for dir in /opt/*/WebSphere/AppServer/profiles/*
do
	profile="${dir##*/}"
	for file in "${dir}"/properties/*.props "${dir}"/properties/*.properties "${dir}"/properties/*.policy
	do
		category="${file##*/}"
		scc_check_file "${file}" "fix:WebSphere:Application Server:profile ${profile}:${category}::" "#"
	done
done

# Handle WPS: WebSphere Process Server
for dir in /opt/*/WebSphere/ProcServer/profiles/*
do
	profile="${dir##*/}"
	for file in "${dir}"/properties/*.props "${dir}"/properties/*.properties "${dir}"/properties/*.policy
	do
		category="${file##*/}"
		scc_check_file "${file}" "fix:WebSphere:Process Server:profile ${profile}:${category}::" "#"
	done
done

# TODO
# extend policy class with grant.
# version/profile.version
# configuration/config.ini

exit 0
