samba share setup on linux clients

John Abreau jabr-iwcNaMm7aMIiq3RsQ1AnAw at public.gmane.org
Sun Jan 18 15:16:10 EST 2009


On Sun, Jan 18, 2009 at 10:49 AM, jbk <jbk-SkCWf5sxpj0sV2N9l4h3zg at public.gmane.org> wrote:

> This is working except if the server is off or the network
> is down, then the user login will hang waiting for the
> shares to mount.
> So I would think a user script in ~/bin would be the thing
> to do. In this script I would want to test if the server is
> available and then if even better if the share is available.
>  Then mount the share if success else die gracefully
> without hanging the system. Even better would be to raise a
> gnome window with the message "Share <share> not available.
> Is the server on?"


You seem to have the right idea there.

    ping -w 1 -c 1 SERVER

ping the server winth only 1 packet, and terminate ping after 1 second
regardless of whether it got a response yet. So ping won't hang for a
long time if the server or network is down.

    smbclient -NL SERVER

List shares on the server, don't prompt for a password. If you get a list,
then the server must be up.


-- 
John Abreau / Executive Director, Boston Linux & Unix
AIM abreauj / JABBER jabr-iMZfmuK6BGBxLiRVyXs8+g at public.gmane.org / YAHOO abreauj / SKYPE zusa_it_mgr
Email jabr-mNDKBlG2WHs at public.gmane.org / WWW http://www.abreau.net / PGP-Key-ID 0xD5C7B5D9
PGP-Key-Fingerprint 72 FB 39 4F 3C 3B D6 5B E0 C8 5A 6E F1 2C BE 99





More information about the Discuss mailing list