Refactoring Code
This commit is contained in:
14
src/commands/ssh/keys/sync.sh
Normal file
14
src/commands/ssh/keys/sync.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
wxi-ssh-keys-sync(){
|
||||
wxi-header "SSH / Keys / Sync"
|
||||
wxi-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: $VAULT_TOKEN")
|
||||
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: $VAULT_TOKEN" -s | jq -r '.data.keys | @sh' | tr -d \')
|
||||
do
|
||||
echo $name
|
||||
wx-ssh-keys-retrieve $name --multiple
|
||||
done
|
||||
fi
|
||||
wxi-footer
|
||||
}
|
||||
Reference in New Issue
Block a user