Trevor TeC Christian wrote:
On Wed, November 30, 2005 12:55 pm, Jack Tanner said:
>On an FC4 client, I'm mounting an smbfs filesystem over the network. In
>/etc/fstab, I have
>
>//server/share /mount/point smbfs
>credentials=/home/user/.smbcreds,noauto,user 0 0
>
>The user's .bash_profile contains the actual mount command, which goes off
>without a hitch. Consequently, the user can issue
>
>$ umount /mount/point
>
>when necessary.
>
>It's all well and good, until the user connects to the FC4 client twice,
>and
>runs two xterms which both source .bash_profile.
>
>Now the mount command has been issued twice, so here's what happens:
>
Should script such that the share isn't mounted unless it isn't already
mounted.
something like -
#!/bin/bash
MOUNT='/bin/mount'
MOUNTPOINT='/mount/point'
if [ "`$MOUNT | grep "$MOUNTPOINT"`" = "" ]
then
mount /mount/point
fi