#!/bin/sh
# Begin /etc/init.d/samba

#
# Include the functions declared in the /etc/init.d/functions file
#

source /etc/init.d/functions

case "$1" in
        start)
                echo -n "Starting Samba daemon..."
#                loadproc /usr/local/sbin/nmbd
		/usr/local/sbin/nmbd -D

                echo -n "...Samba daemon started!"
#                loadproc /usr/local/sbin/smbd
		/usr/local/sbin/smbd -D
                ;;

        stop)
                echo -n "Stopping Samba daemon!"
                killproc smbd

                echo -n "...Samba daemon stopped."
                killproc nmbd
                ;;

        reload)
        echo -n "Reloading Samba daemon configuration file..."
                reloadproc smbd
        ireloadproc nmbd
                ;;

        restart)
                $0 stop
                /usr/bin/sleep 1
                $0 start
                ;;

        status)
                statusproc /usr/local/sbin/nmbd
                statusproc /usr/local/sbin/smbd
                ;;

        *)
                echo "Usage: $0 {start|stop|reload|restart|status}"
                exit 1
        ;;

esac

# End /etc/init.d/samba
