-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathquickunseal.sh
executable file
·48 lines (43 loc) · 1.17 KB
/
quickunseal.sh
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
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env bash
## You likely should only
## use this for the test env,
## because it bypasses
## an important part of the Vault
## seal and encryption process.
## You probably don't want that
## in Production.
KEY1=$1
KEY2=$2
VAULT_ADDR='http://192.168.13.35:8200'
echo " ## Unseal"
echo " ## https://www.vaultproject.io/api/system/unseal.html"
echo ""
echo " ## Unsealing ${VAULT_ADDR}"
curl \
--request PUT \
--data "{\"key\": \"${KEY1}\"}" \
"${VAULT_ADDR}/v1/sys/unseal" | jq
curl \
--request PUT \
--data "{\"key\": \"${KEY2}\"}" \
"${VAULT_ADDR}/v1/sys/unseal" | jq
VAULT_ADDR='http://192.168.13.36:8200'
echo " ## Unsealing ${VAULT_ADDR}"
curl \
--request PUT \
--data "{\"key\": \"${KEY1}\"}" \
"${VAULT_ADDR}/v1/sys/unseal" | jq
curl \
--request PUT \
--data "{\"key\": \"${KEY2}\"}" \
"${VAULT_ADDR}/v1/sys/unseal" | jq
VAULT_ADDR='http://192.168.13.37:8200'
echo " ## Unsealing ${VAULT_ADDR}"
curl \
--request PUT \
--data "{\"key\": \"${KEY1}\"}" \
"${VAULT_ADDR}/v1/sys/unseal" | jq
curl \
--request PUT \
--data "{\"key\": \"${KEY2}\"}" \
"${VAULT_ADDR}/v1/sys/unseal" | jq