#!/bin/sh
# chkconfig: 2345 50 50
# description: SAMBA daemon
#
# GNU GPL (c) Eko M. Budi, 2004
#         (c) Vector Linux. 2004

# Include the functions declared in the /etc/rc.d/functions file
source /etc/rc.d/functions

#server name & description
SMBSERVER="SAMBA Network File/Printer sharing server"
NMBSERVER="SAMBA Netbios name server"

SMBD=/usr/sbin/smbd
NMBD=/usr/sbin/nmbd

case "$1" in
        start)
                echon "Starting $SMBSERVER....."
                loadproc $SMBD -D
                echon "Starting $NMBSERVER....."
		loadproc $NMBD -D
                ;;
        stop)
                echon "Stopping $NMBSERVER....."
		killproc $NMBD 
                echon "Stopping $SMBSERVER....."
                killproc $SMBD 
                ;;
	reload)
                echon "Reloading $SMBSERVER....."
                reloadproc $SMBD 
                echon "Reloading $NMBSERVER....."
		reloadproc $NMBD 
                ;;
        restart)
                $0 stop
                /bin/sleep 2
                $0 start
                ;;
        *)
                echo "Usage: $0 {start|stop|reload|restart}"
                exit 1
        ;;
esac
