#!/bin/sh
#
-# chkconfig: 345 81 45
+# chkconfig: 345 91 45
# description: Starts and stops the Samba winbind daemon to provide \
# user and group information from a domain controller to linux.
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
-# Check that smb.conf exists.
-[ -f /etc/samba/smb.conf ] || exit 0
-
-RETVAL=0
+CONFIG=/etc/samba/smb.conf
+# Check that smb.conf exists.
+[ -f $CONFIG ] || exit 0
start() {
echo -n "Starting Winbind services: "
RETVAL=1
- if [ "`grep -i 'winbind uid' /etc/samba/smb.conf | egrep -v [\#\;]`" ]; then
- daemon winbindd
+ if [ "`egrep -i '(idmap.*uid|winbind.*uid)' $CONFIG | egrep -v [\#\;]`" ]; then
+ daemon winbindd
RETVAL=$?
fi
echo
stop() {
echo -n "Shutting down Winbind services: "
RETVAL=1
- if [ "`grep -i 'winbind uid' /etc/samba/smb.conf | egrep -v [\#\;]`" ]; then
+ if [ "`egrep -i '(idmap.*uid|winbind.*uid)' $CONFIG | egrep -v [\#\;]`" ]; then
killproc winbindd
RETVAL=$?
fi