On Monday 03 November 2008 15:16:33 Jeff Moyer wrote: > Ian Kent <[EMAIL PROTECTED]> writes: > > On Mon, 2008-11-03 at 11:32 +0900, Ian Kent wrote: > >> Hi all, > >> > >> Stef Bon has reported some difficulty with the current auto.smb. > > -opts="-fstype=cifs" > > + > > +FILESYSTEM="cifs" > > + > > So, umm, when is $FILESYSTEM not going to be cifs? > That's a good one. I thought it's a good thing to still support smbfs, which is not cifs obviously.
> > +if [ "$FILESYSTEM" != "cifs" ]; then > > + opts="-fstype=$FILESYSTEM,guest" > > +else > > + for P in /bin /sbin /usr/bin /usr/sbin > > + do > > + if [ -x $P/nmblookup ]; then > > + NMBLOOKUP=$P/nmblookup > > + break > > + fi > > + done > > + > > + if [ ! -x "$NMBLOOKUP" ]; then > > + exit 1 > > + fi > > Is it possible to not have the nmblookup program? It seems to me it > would be safer to at least try the mount w/o the ip address if you can't > obtain one. Yes, that's also good choice. Now the script fails when nmblookup is not found, which is not always necessary. > > > + > > + ipaddress=$($NMBLOOKUP $key --debug-level=0 2>>/dev/null | grep '<00>' > > | awk '{ print $1 }') + if [ -z "$ipaddress" ]; then > > + exit 1 > > + fi > > + > > + opts="-fstype=cifs,guest,ip=$ipaddress" > > +fi > > > > for P in /bin /sbin /usr/bin /usr/sbin > > do > > Can we compress these two loops that do the same thing (determine the > path to the samba/cifs binaries)? Yes possibly. But the loop to find nmblookup is only done when using cifs (see above..). Also, when combined, the loop should not stop when only one is found, but both. But yes it's possible to create one loop with some if and thens. Stef
_______________________________________________ autofs mailing list autofs@linux.kernel.org http://linux.kernel.org/mailman/listinfo/autofs