#!/sbin/runscript
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
# $Header: /var/cvsroot/gentoo-x86/net-fs/samba/files/winbind-init,v 1.2 2003/02/14 23:00:20 vapier Exp $

depend() {
	need net
}

start() {
	ebegin "Starting winbind"
	start-stop-daemon --start --quiet --exec /usr/sbin/smbd
	result=$?
	start-stop-daemon --start --quiet --exec /usr/sbin/nmbd
	result=$(( $result + $? ))
	start-stop-daemon --start --quiet --exec /usr/sbin/winbindd
	result=$(( $result + $? ))
	eend $result
}

stop() {
	ebegin "Stopping samba"
	start-stop-daemon --stop --quiet --pidfile /var/run/samba/smbd.pid
	result=$?
	start-stop-daemon --stop --quiet --pidfile /var/run/samba/nmbd.pid
	result=$(( $result + $? ))
	start-stop-daemon --stop --quiet --pidfile /var/run/samba/winbindd.pid
	result=$(( $result + $? ))
	eend $result
}
