the mount command on its own returns a list of all current mounts,
which you can grep and then conditionally mount.

Why are you doing this via a script when you could put them in fstab
and make it happen automatically?

On Mon, Oct 6, 2008 at 9:10 AM, Roger Searle <[EMAIL PROTECTED]> wrote:
> Hi, I have a bash script to mount some network drives like:
>
> mount //machine/share /home/roger/network/machine/share -t cifs -o
> credentials= . . .
>
> which is all good except if it is run a second time (for example, one of the
> machines wasn't turned on the first time it was run) I'll end up with those
> shares that were mounted the first time mounted an additional time (as shown
> by the mount command).  How might I be able to modify this to be a little
> more intelligent, and go "if the share is already mounted, ignore the
> following mount command, otherwise, do the mount command".
> Cheers,
> Roger
>
>

Reply via email to