]> git.pld-linux.org Git - packages/samba.git/blobdiff - winbind.init
- rel 1
[packages/samba.git] / winbind.init
index 8497e91a4383405081cfdbe0bf520b052963d3c6..44392867078c8ac863ab8e5a430e4ce7dc47d3ca 100644 (file)
@@ -32,14 +32,21 @@ TMPDIR="/tmp"; export TMPDIR
 # Check that smb.conf exists.
 [ -f /etc/samba/smb.conf ] || exit 0
 
+# return true if 'idmap uid' or 'idmap gid' is set in samba config
+configtest() {
+       egrep -qi '^idmap [ug]id' /etc/samba/smb.conf
+}
+
 start() {
        if [ ! -f /var/lock/subsys/winbind ]; then
-               if [ "`grep -i 'idmap uid' /etc/samba/smb.conf | egrep -v [\#\;]`" -a "`grep -i 'idmap gid' /etc/samba/smb.conf | egrep -v [\#\;]`" ]; then
+               if configtest; then
                        msg_starting winbindd
-                       daemon winbindd
+                       daemon /usr/sbin/winbindd
                        RETVAL=$?
-                       [ $RETVAL -eq 0 ] && touch /var/lock/subsys/winbind || \
-                       RETVAL=1
+                       if [ $RETVAL -eq 0 ]; then
+                               touch /var/lock/subsys/winbind
+                               RETVAL=1
+                       fi
                else
                        nls "Winbind is not configured in /etc/samba/smb.conf, not starting"
                fi
This page took 0.028722 seconds and 4 git commands to generate.