aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2015-09-13 18:08:15 +0200
committerJakob Unterwurzacher2015-09-13 18:08:15 +0200
commit164739b65588bcad91425f38db1ae1aae5c15e56 (patch)
treeceb9b7c1633c965a3fc4ebd1d5a7b7a8be8a84d7 /main.go
parent4acaeb668ea236ded06157fd312463b5faafbdab (diff)
Friendlier error message if gocryptfs.conf does not exist
Diffstat (limited to 'main.go')
-rw-r--r--main.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/main.go b/main.go
index d0aa33f..6315805 100644
--- a/main.go
+++ b/main.go
@@ -80,6 +80,12 @@ func main() {
}
cfname := filepath.Join(cipherdir, cryptfs.ConfDefaultName)
+ _, err = os.Stat(cfname)
+ if err != nil {
+ fmt.Printf("Error: %s not found in CIPHERDIR\n", cryptfs.ConfDefaultName)
+ fmt.Printf("Please run \"%s --init %s\" first\n", PROGRAM_NAME, cipherdir)
+ os.Exit(ERREXIT_LOADCONF)
+ }
cf, err := cryptfs.LoadConfFile(cfname)
if err != nil {
fmt.Println(err)