Check if ssh key exists

This commit is contained in:
2021-04-16 00:29:01 +01:00
parent 3e6f3a1b3e
commit 6ee7970821
2 changed files with 7 additions and 2 deletions

View File

@@ -38,6 +38,7 @@ alias \
sdn="sudo shutdown -h now" \
e="$EDITOR" \
v="$EDITOR" \
cl="clear" \
p="sudo pacman" \
z="zathura" \
ll="ls -l" \

View File

@@ -1,6 +1,6 @@
#!/bin/bash
LABS=$(enpasscli -vault="$HOME/Documents/Enpass/Vaults/Primary" -sort show "Scarif: Labs" 2>&1)
LABS=$(enpasscli -vault="$HOME/Documents/Enpass/Vaults/primary" -sort show "Scarif: Labs" 2>&1)
LABSUN=$(echo "$LABS" | grep -Po "(?<=login: )\w+")
LABSPW=$(echo "$LABS" | grep -Po "(?<=pass : ).+(?=\")")
@@ -18,7 +18,11 @@ generate_post_data() {
EOF
}
CREDENTIALS=$(echo "$LABSUN:$LABSPW" | base64)
CREDENTIALS="$LABSUN:$LABSPW"
KEYS=$(curl -X GET -s --url "https://$CREDENTIALS@labs.scarif.space/api/v1/users/$LABSUN/keys")
echo $KEYS | jq '.[].title'
curl --request POST \
-s \