libgocryptfs/main.go

29 lines
574 B
Go
Raw Normal View History

2015-09-03 19:27:07 +02:00
package main
import (
"github.com/rfjakob/cluefs/lib/cluefs"
2015-09-03 19:27:07 +02:00
"github.com/rfjakob/gocryptfs/frontend"
"os"
2015-09-03 19:27:07 +02:00
)
func main() {
// Parse command line arguments
conf, err := cluefs.ParseArguments()
2015-09-03 19:27:07 +02:00
if err != nil {
os.Exit(1)
2015-09-03 19:27:07 +02:00
}
// Create the file system object
2015-09-03 19:27:07 +02:00
var key [16]byte
cfs := frontend.NewFS(key, conf.GetShadowDir())
2015-09-03 19:27:07 +02:00
// Mount and serve file system requests
if err = cfs.MountAndServe(conf.GetMountPoint(), conf.GetReadOnly()); err != nil {
cluefs.ErrlogMain.Printf("could not mount file system [%s]", err)
os.Exit(3)
2015-09-03 19:27:07 +02:00
}
// We are done
os.Exit(0)
2015-09-03 19:27:07 +02:00
}