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:
parent
692b51f159
commit
eef32809f4
1 changed files with 2 additions and 1 deletions
3
main.go
3
main.go
|
@ -17,6 +17,7 @@ var config = struct {
|
||||||
SealTokensRaw string `flag:"tokens" default:"" description:"Tokens to try for unsealing the vault instance"`
|
SealTokensRaw string `flag:"tokens" default:"" description:"Tokens to try for unsealing the vault instance"`
|
||||||
SealTokens []string
|
SealTokens []string
|
||||||
VaultInstance string `flag:"instance" env:"VAULT_ADDR" default:"http://127.0.0.1:8200" description:"Vault instance to unlock"`
|
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() {
|
func init() {
|
||||||
|
@ -82,7 +83,7 @@ func main() {
|
||||||
if config.OneShot {
|
if config.OneShot {
|
||||||
break
|
break
|
||||||
} else {
|
} else {
|
||||||
<-time.After(10 * time.Second)
|
<-time.After(time.Duration(config.Sleep) * time.Second)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue