r5265: ensure that the Fedora RPMS build with cups support
[ira/wip.git] / packaging / RedHat / winbind.init
index 291c351df3aa7ed13961d15b963b9165b9bb1e86..1635dca93be098f3bf4c7fc05490d01d9bae182d 100644 (file)
@@ -1,6 +1,6 @@
 #!/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.
 
@@ -19,17 +19,16 @@ fi
 # 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
@@ -40,7 +39,7 @@ start() {
 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