-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.go
36 lines (30 loc) · 831 Bytes
/
main.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
33
34
35
36
package main
import (
"flag"
"fmt"
"os"
vaultpull "github.com/NorkzYT/Wolflith/Scripts/Vault/vaultPull"
vaultpush "github.com/NorkzYT/Wolflith/Scripts/Vault/vaultPush"
)
func main() {
// Define a flag to specify the action
action := flag.String("action", "", "Specify 'pull' to pull secrets, or 'push' to push secrets to Hashicorp Vault.")
flag.Parse()
// Check if an action was provided
if *action == "" {
fmt.Println("You must specify an action using the -action flag.")
os.Exit(1)
}
repoLocation := "/opt/Wolflith"
switch *action {
case "pull":
fmt.Println("Pulling secrets...")
vaultpull.PullSecrets(repoLocation)
case "push":
fmt.Println("Pushing secrets...")
vaultpush.PushSecrets(repoLocation)
default:
fmt.Printf("Invalid action: %s. Use 'pull' or 'push'.\n", *action)
os.Exit(1)
}
}