#!/bin/dash
# samba winbindd NetBIOS name resolution
# Description: Enable Samba/Windows NetBIOS name resolution 

start_daemon() {
	winbindd
}

stop_daemon() {
	while pidof winbindd > /dev/null; do killall winbindd 2>/dev/null; done
}

is_up_daemon() {
	pidof winbindd > /dev/null
}

case "$1" in
	start)
		start_daemon
		;;

	stop)
		stop_daemon
		;;
	
	restart)
		stop_daemon
		sleep 1
		start_daemon
		;;
		
	status)
		is_up_daemon && echo "winbindd is running." || echo "winbindd is stopped."
		;;		

esac
