diff --git a/src/commands/infra.sh b/src/commands/infra.sh index b7b07de..d041876 100644 --- a/src/commands/infra.sh +++ b/src/commands/infra.sh @@ -21,6 +21,19 @@ wx-infra(){ fi fi + if [[ ! -f "$INFRA_PATH/vault/cwchristerw" || ! -f "$INFRA_PATH/vault/warengroup" ]] + then + curl \ + -H "X-Vault-Token: ${config["login",$ORG]}" \ + -X GET \ + https://$VAULT_DOMAIN/v1/cli/data/cwchristerw/settings/infra -s | jq -r '.data.data.cwchristerw' > "$INFRA_PATH/vault/cwchristerw" + + curl \ + -H "X-Vault-Token: ${config["login",$ORG]}" \ + -X GET \ + https://$VAULT_DOMAIN/v1/cli/data/cwchristerw/settings/infra -s | jq -r '.data.data.warenroup' > "$INFRA_PATH/vault/warengroup" + fi + if [[ -z $1 ]] then echo "Tag Required" diff --git a/wx b/wx index c195db6..57e293f 100755 --- a/wx +++ b/wx @@ -154,6 +154,19 @@ wx-infra(){ fi fi + if [[ ! -f "$INFRA_PATH/vault/cwchristerw" || ! -f "$INFRA_PATH/vault/warengroup" ]] + then + curl \ + -H "X-Vault-Token: ${config["login",$ORG]}" \ + -X GET \ + https://$VAULT_DOMAIN/v1/cli/data/cwchristerw/settings/infra -s | jq -r '.data.data.cwchristerw' > "$INFRA_PATH/vault/cwchristerw" + + curl \ + -H "X-Vault-Token: ${config["login",$ORG]}" \ + -X GET \ + https://$VAULT_DOMAIN/v1/cli/data/cwchristerw/settings/infra -s | jq -r '.data.data.warenroup' > "$INFRA_PATH/vault/warengroup" + fi + if [[ -z $1 ]] then echo "Tag Required"