Last active
May 12, 2018 02:43
-
-
Save vishalnayak/3a030f0502aba3109abb05ca8c371cf9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -aex | |
initResult=$(vault operator init -format json -key-shares 1 -key-threshold 1) | |
unsealKey=$(echo -n $initResult | jq -r '.unseal_keys_b64[0]') | |
rootToken=$(echo -n $initResult | jq -r '.root_token') | |
# Store the unseal key and the root token for future use | |
echo -n $unsealKey > unsealKey | |
echo -n $rootToken > rootToken | |
vault operator unseal `cat unsealKey` | |
vault login `cat rootToken` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment