aboutsummaryrefslogtreecommitdiff
path: root/main.go
blob: af7bd2160dc99d0ae966474884af802dfd54431e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package main

import (
	"github.com/rfjakob/cluefs/lib/cluefs"
	"github.com/rfjakob/gocryptfs/frontend"
	"os"
)

func main() {
	// Parse command line arguments
	conf, err := cluefs.ParseArguments()
	if err != nil {
		os.Exit(1)
	}

	// Create the file system object
	var key [16]byte
	cfs := frontend.NewFS(key, conf.GetShadowDir())

	// 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)
	}

	// We are done
	os.Exit(0)
}