#!/bin/sh
#
. /opt/HAC/bin/rsf.sh

service=${RSF_SERVICE:-"service_name"}
script="`basename $0`"
SMBCONTROL="smbcontrol"
SMBSTATUS="smbstatus"

case "${1}" in
    'start')
	rc_exit ${service} ${RSF_OK}
	;;

    'stop')
        if [ "${PROP_SMBENABLED}" = "true" ] ; then 
	    ${SMBCONTROL} smbd close-share '*' 
	    dated_echo "=========  ${SMBSTATUS} ========="
	    ${SMBSTATUS}
	    dated_echo "=========  ${SMBSTATUS} ========="
        else
            dated_echo "Samba share handling not enabled - nothing to do"
        fi
        rc_exit ${service} ${RSF_OK}
        ;;

    'check')
	exit ${RSF_CHECK_NORESRC}
	;;

    *)
	rc_exit ${service} ${RSF_WARN} "usage: $0 <start|stop|check>"
	;;
esac
