[SLUG] autofs + samba

From: Eben King (eben01@verizon.net)
Date: Sun May 16 2010 - 01:25:34 EDT


I'm trying to set up autofs on my laptop, to automatically mount/dismount my
desktop's Samba/SMB shares. I'm following this guide:
http://www.howtoforge.com/accessing_windows_or_samba_shares_using_autofs
though from what I can tell the same script and similar instructions are in
many places on the net.

The script defines $key:

key="$1"

then defines credfile:

credfile="/etc/auto.smb.$key"

It needs to be a valid filename. The web page says I should
,--
| create a file called
|
| /etc/auto.smb.FILESERVERNAME
|
| for each computer you want to access.
'--

OK, so credfile needs to end with the servername (in my case, "pc") for that
to match. But when the script runs, $key gets server/share (in my case
"pc/mp3") which makes credfile "/etc/auto.smb.pc/mp3" which is an illegal
filename.

Later on the script runs

$SMBCLIENT $smbclientopts -gL $key

I checked the man page for smbclient and didn't find "-g". And "-L" needs a
servername. So is $key wrongly defined, maybe it should be ${1%*}?

-- 
-eben   QebWenE01R@vTerYizUonI.nOetP   http://royalty.mine.nu:81
               "God does not play dice" -- Einstein
        "Not only does God play dice, he sometimes throws
        them where they can't be seen." -- Stephen Hawking
-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS).  Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 15:25:55 EDT