#!/bin/sh
#
# $Id: service_get_deps_nfs,v 1.1.1.1 2005/05/11 09:03:12 gleissner Exp $
#
#
# Project     :  SCPM (System Configuration Profile Management)
# Module      :  SCPM utilities
# File        :  service_get_deps_nfs
# Description :  Special dependency output script for nfs resource
# 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).
#

SERVICE_DEPS="\
network
route
portmap"

FILE_DEPS="\
/etc/init.d/nfs
/etc/fstab"

show_usage()
{
    echo "$0 [options] init_script resource_type"
    echo
    echo "options may be"
    echo
    echo "-h   shows help (this one)"
}

while test -n "$1" ; do
    case "$1" in
        -h)
	show_usage
	exit 0
	;;

	*)
	if [ -n "$SERVICE" ]; then
	    test -n "$RESTYPE" && { echo "unknown option $1" >&2 ; exit 1 ; }
	    RESTYPE=$1
	else
	    SERVICE=$1
	fi
	;;
    esac
    shift
done

test -z "$SERVICE" && { echo "No service given" >&2 ; exit 1 ; }
test -z "$RESTYPE" && { echo "No resource type given" >&2 ; exit 1 ; }

case $RESTYPE in

    service|rcservice)
    echo "$SERVICE_DEPS"
    ;;

    file)
    echo "$FILE_DEPS"
    ;;

    sysconfig)
    ;;

    *)
    echo "Unknown resource type $RESTYPE" >&2
    exit 1
    ;;

esac

exit 0
