summaryrefslogtreecommitdiff
path: root/init_dir.go
diff options
context:
space:
mode:
Diffstat (limited to 'init_dir.go')
-rw-r--r--init_dir.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/init_dir.go b/init_dir.go
index 2642dd2..c52e2fa 100644
--- a/init_dir.go
+++ b/init_dir.go
@@ -18,7 +18,13 @@ import (
// not to be empty.
func initDir(args *argContainer) {
var err error
- if !args.reverse {
+ if args.reverse {
+ _, err = os.Stat(args.config)
+ if err == nil {
+ tlog.Fatal.Printf("Config file %q already exists", args.config)
+ os.Exit(ERREXIT_INIT)
+ }
+ } else {
err = checkDirEmpty(args.cipherdir)
if err != nil {
tlog.Fatal.Printf("Invalid cipherdir: %v", err)