[PLUG] NFS monitored mount
Mon Sep 24 02:57:05 PDT 2007
On Monday 24 Sep 2007 15:09:51 Ketan Padegaonkar wrote:
> On 9/24/07, Aditya Godbole <aag.lists at gmail.com> wrote:
> > Hi,
> > I want to mount a NFS share if it has not been mounted already. The
> > program should return success if the share is already mounted or if
> > it gets mounted successfully, and failure otherwise.
> > Is there any existing script/daemon I can use?
> Did you look at autofs and automount ?
Also isn't this simple enough?
if [ `mount|grep <mountpoint> >|wc -l` -eq 0 ]; then
echo "<mountpoint> is already mounted";
Actually just blindly mount works too. It gives a warning which you can ignore
but at the end share is guaranteed to be mounted :)
More information about the plug-mail