2019-10-28 00:12:10 +08:00
|
|
|
package command
|
|
|
|
|
|
|
|
import (
|
2019-11-27 22:57:14 +08:00
|
|
|
"strings"
|
|
|
|
|
2019-11-14 14:26:59 +08:00
|
|
|
"github.com/chrislusf/seaweedfs/weed/util"
|
2019-10-28 00:12:10 +08:00
|
|
|
"github.com/seaweedfs/fuse"
|
|
|
|
)
|
|
|
|
|
|
|
|
func osSpecificMountOptions() []fuse.MountOption {
|
|
|
|
return []fuse.MountOption{
|
|
|
|
fuse.AllowNonEmptyMount(),
|
|
|
|
}
|
|
|
|
}
|
2019-11-14 14:26:59 +08:00
|
|
|
|
|
|
|
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
|
|
|
|
}
|