From: Stef Bon Subject: Modified auto.smb script Date: Fri, 24 Oct 2008 16:46:56 +0200 Message-ID: <200810241646.56647.stef@bononline.nl> Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_g/dAJfwBWT6ZMhs" Return-path: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: autofs-bounces@linux.kernel.org Errors-To: autofs-bounces@linux.kernel.org To: Ian Kent Cc: autofs@linux.kernel.org --Boundary-00=_g/dAJfwBWT6ZMhs Content-Type: multipart/alternative; boundary="Boundary-00=_g/dAJopkEGdlO/7" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-00=_g/dAJopkEGdlO/7 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hi, I've sent this email before. Can you confirm it's arrived? Stef Hello, I've modified the auto.smb script to make use of cifs in stead of smbfs. In my network mounting a SMB share with cifs fails, unless the ipaddress is an option:ip=$ipaddress. It uses the tool nmblookup for that. Futher I'm working on an howto which describes the various ways to mount SMB shares. Stef Bon the Netherlands --Boundary-00=_g/dAJopkEGdlO/7 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: 7bit


Hi,


I've sent this email before. Can you confirm it's arrived?


Stef


Hello,


I've modified the auto.smb script to make use of cifs in stead of smbfs.


In my network mounting a SMB share with cifs fails, unless the ipaddress is an
option:ip=$ipaddress.


It uses the tool nmblookup for that.


Futher I'm working on an howto which describes the various ways to mount SMB
shares.



Stef Bon
the Netherlands


--Boundary-00=_g/dAJopkEGdlO/7-- --Boundary-00=_g/dAJfwBWT6ZMhs Content-Type: application/x-shellscript; name="auto.smb" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="auto.smb" #!/bin/bash # This file must be executable to work! chmod 755! key="$1" FILESYSTEM="cifs" if [ "$FILESYSTEM" = "cifs" ]; then for P in /bin /sbin /usr/bin /usr/sbin do if [ -x $P/nmblookup ] then NMBLOOKUP=$P/nmblookup break fi done [ -x $NMBLOOKUP ] || exit 1 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" else opts="-fstype=$FILESYSTEM,guest" fi for P in /bin /sbin /usr/bin /usr/sbin do if [ -x $P/smbclient ] then SMBCLIENT=$P/smbclient break fi done [ -x $SMBCLIENT ] || exit 1 $SMBCLIENT -gNL $key 2>/dev/null| awk -v key="$key" -v opts="$opts" -F'|' -- ' BEGIN { ORS=""; first=1 } /Disk/ { if (first) print opts; first=0 dir = $2 loc = $2 # Enclose mount dir and location in quotes # Double quote "$" in location as it is special gsub(/\$$/, "\\$", loc); print " \\\n\t \"/" dir "\"", "\"://" key "/" loc "\"" } END { if (!first) print "\n"; else exit 1 } ' --Boundary-00=_g/dAJfwBWT6ZMhs Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ autofs mailing list autofs@linux.kernel.org http://linux.kernel.org/mailman/listinfo/autofs --Boundary-00=_g/dAJfwBWT6ZMhs--