-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbackup.go
32 lines (30 loc) · 804 Bytes
/
backup.go
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
29
30
31
32
package main
import (
"clout/session"
"fmt"
"os"
)
func HandleBackup(argMap map[string]string) {
words := os.Getenv("CLOUT_PHRASE")
if len(words) < 36 {
fmt.Println("")
fmt.Println("Backup allows you to have just one list of words to unlock")
fmt.Println("many other lists of words for N number of accounts.")
fmt.Println("")
fmt.Println("export CLOUT_PHRASE='these are some nice words and stuff.'")
fmt.Println("")
fmt.Println("Set an envionment variable called CLOUT_PHRASE with your words.")
fmt.Println("The string must be >= 36.")
fmt.Println("")
return
}
if argMap["restore"] != "" {
session.SecretsFromBackup(words)
return
}
fmt.Println("")
fmt.Println("Found CLOUT_PHRASE size is", len(words))
fmt.Println("")
session.BackupSecrets(words)
fmt.Println("")
}