Code Update
This commit is contained in:
@@ -32,7 +32,7 @@ wx-ssh-keys(){
|
||||
}
|
||||
|
||||
wx-ssh-keys-generate(){
|
||||
wx-header "SSH / Keys"
|
||||
wx-header "SSH / Keys / Generate"
|
||||
wx-restricted
|
||||
if [[ ! -z $1 ]]
|
||||
then
|
||||
@@ -44,7 +44,7 @@ wx-ssh-keys-generate(){
|
||||
}
|
||||
|
||||
wx-ssh-keys-sign(){
|
||||
wx-header "SSH / Sign"
|
||||
wx-header "SSH / Keys / Sign"
|
||||
wx-restricted
|
||||
|
||||
if [[ $ORG == "warengroup" ]]
|
||||
@@ -82,7 +82,11 @@ wx-ssh-keys-sign-create(){
|
||||
}
|
||||
|
||||
wx-ssh-keys-retrieve(){
|
||||
wx-header "SSH / Keys"
|
||||
if [[ -z $2 ]]
|
||||
then
|
||||
wx-header "SSH / Keys / Retrieve"
|
||||
fi
|
||||
|
||||
wx-restricted
|
||||
if [[ ! -z $1 ]]
|
||||
then
|
||||
@@ -96,7 +100,7 @@ wx-ssh-keys-retrieve(){
|
||||
}
|
||||
|
||||
wx-ssh-keys-save(){
|
||||
wx-header "SSH / Keys"
|
||||
wx-header "SSH / Keys / Save"
|
||||
wx-restricted
|
||||
if [[ ! -z $1 ]]
|
||||
then
|
||||
@@ -108,14 +112,24 @@ wx-ssh-keys-save(){
|
||||
}
|
||||
|
||||
wx-ssh-keys-sync(){
|
||||
wx-header "SSH / Keys"
|
||||
wx-header "SSH / Keys / Sync"
|
||||
wx-restricted
|
||||
|
||||
VAULT_STATUS=$(curl -s -o /dev/null -w "%{http_code}" https://$VAULT_DOMAIN/v1/cli/metadata/$USERNAME/settings/ssh/keys -X LIST --header "X-Vault-Token: ${config["login",$ORG]}")
|
||||
if [[ $VAULT_STATUS -eq 200 ]]
|
||||
then
|
||||
for name in $(curl https://$VAULT_DOMAIN/v1/cli/metadata/$USERNAME/settings/ssh/keys -X LIST --header "X-Vault-Token: ${config["login",$ORG]}" -s | jq -r '.data.keys | @sh' | tr -d \')
|
||||
do
|
||||
echo $name
|
||||
wx-ssh-keys-retrieve $name --multiple
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
wx-ssh-keys-clean(){
|
||||
if [[ -z $1 ]]
|
||||
then
|
||||
wx-header "SSH / Keys"
|
||||
wx-header "SSH / Keys / Clean"
|
||||
fi
|
||||
wx-restricted
|
||||
|
||||
|
||||
Reference in New Issue
Block a user