#!/bin/sh
#
# $Id: sysconfig_get_all,v 1.2 2005/12/13 16:30:15 gleissner Exp $
#
#
# Project     :  SCPM (System Configuration Profile Management)
# Module      :  SCPM Utilities
# File        :  sysconfig_get_all
# Description :  Determines all sysconfig resources
# Author      :  Joachim Gleissner <jg@suse.de>
#
# Copyright 2001 SuSE GmbH
#
# Released under the terms of the GNU General Public License
# (see file COPYRIGHT in project root directory).
#

SYSCONFIG_DIRS="network isdn"

. /etc/sysconfig/scpm || exit 1

if [ -n "$RESOURCE_SET" ]; then
    if [ -f /var/lib/scpm/resource_sets/$RESOURCE_SET ]; then
	SET=/var/lib/scpm/resource_sets/$RESOURCE_SET
    elif [ -f $LIBDIR/resource_sets/$RESOURCE_SET ]; then
	SET=$LIBDIR/resource_sets/$RESOURCE_SET
    else
	echo "resource set $RESOURCE_SET unknown" >&2
	exit 1
    fi
    while read TYPE NAME ; do
	test "${TYPE}" = "sysconfig" && echo "$NAME"
    done < $SET
    exit 0
fi

for i in $SYSCONFIG_DIRS ; do
    test -d /etc/sysconfig/$i && echo $i
done

exit 0
