On Monday 24 Sep 2007 15:09:51 Ketan Padegaonkar wrote:
> On 9/24/07, Aditya Godbole <[EMAIL PROTECTED]> 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 ?
> (http://tldp.org/HOWTO/Automount.html)

Also isn't this simple enough?

if [  `mount|grep <mountpoint> >|wc -l` -eq 0 ]; then 
        mount <mountpoint>; 
else 
        echo "<mountpoint> is already mounted"; 
fi

Actually just blindly mount works too. It gives a warning which you can ignore 
but at the end share is guaranteed to be mounted :)

Shridhar

--
______________________________________________________________________
Pune GNU/Linux Users Group Mailing List:      ([email protected])
List Information:  http://plug.org.in/cgi-bin/mailman/listinfo/plug-mail
Send 'help' to [EMAIL PROTECTED] for mailing instructions.
  • [PLUG] NFS monito... Aditya Godbole
    • Re: [PLUG] N... Ketan Padegaonkar
      • Re: [PLU... श्रीधर नारायण दैठणकर
        • Re: ... Shantanoo Mahajan
          • ... श्रीधर नारायण दैठणकर
        • Re: ... Aditya Godbole
          • ... श्रीधर नारायण दैठणकर

Reply via email to