#!/usr/bin/sh
#----------------------------------------------------------------------------------
# /var/install/bin/nfsserver-show-shares - show nfsserver server shares
#
# Copyright (c) 2001-2024  The Eisfair Team, team(at)eisfair(dot)org
#
# Creation:     2004-08-11 jed
# Last Update:  $Id$
#
# 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 of the License, or
# (at your option) any later version.
#----------------------------------------------------------------------------------

# read eislib etc.
. /var/install/include/eislib
. /var/install/include/jedlib
. /var/install/include/check-eisfair-version

configfile=/etc/config.d/nfsserver

# Set platform specific parameters
case ${EISFAIR_SYSTEM} in
    eisfair-2)
        default_nfs4_exportpath=/run/nfs4exports
        ;;
    * )
        default_nfs4_exportpath=/var/lib/nfs4exports
        ;;
esac

### load configuration ###
. ${configfile}

clrhome

if [ "${NFSSERVER_SUPPORT_NFS4}" = 'yes' ]
then
    mount | grep -q " ${default_nfs4_exportpath}/"

    if [ $? -eq 0 ]
    then
        mecho --info "NFSv4 mount binds"
        mecho
        mount | grep " ${default_nfs4_exportpath}/"
        mecho
    fi
fi

mecho --info "NFS server shares"
mecho
/usr/sbin/exportfs -v
mecho
anykey

exit 0