1
0
Fork 0
mirror of https://github.com/Luzifer/vault-unseal.git synced 2024-12-22 22:01:20 +00:00

Made sleep interval configurable

This commit is contained in:
Knut Ahlers 2015-08-12 16:49:56 +02:00
parent 692b51f159
commit eef32809f4

View file

@ -17,6 +17,7 @@ var config = struct {
SealTokensRaw string `flag:"tokens" default:"" description:"Tokens to try for unsealing the vault instance"`
SealTokens []string
VaultInstance string `flag:"instance" env:"VAULT_ADDR" default:"http://127.0.0.1:8200" description:"Vault instance to unlock"`
Sleep int `flag:"sleep" default:"30" description:"How long to wait between sealed-state checks"`
}{}
func init() {
@ -82,7 +83,7 @@ func main() {
if config.OneShot {
break
} else {
<-time.After(10 * time.Second)
<-time.After(time.Duration(config.Sleep) * time.Second)
}
}
}