diff options
Diffstat (limited to 'weed/command/mount_linux.go')
| -rw-r--r-- | weed/command/mount_linux.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/weed/command/mount_linux.go b/weed/command/mount_linux.go index 7d94e5142..591951d4f 100644 --- a/weed/command/mount_linux.go +++ b/weed/command/mount_linux.go @@ -1,6 +1,7 @@ package command import ( + "github.com/chrislusf/seaweedfs/weed/util" "github.com/seaweedfs/fuse" ) @@ -9,3 +10,16 @@ func osSpecificMountOptions() []fuse.MountOption { fuse.AllowNonEmptyMount(), } } + +func checkMountPointAvailable(dir string) bool { + mountPoint := dir + if mountPoint != "/" && strings.HasSuffix(mountPoint, "/") { + mountPoint = mountPoint[0 : len(mountPoint)-1] + } + + if mounted, err := util.Mounted(mountPoint); err != nil || mounted { + return false + } + + return true +} |
