Created
April 9, 2022 14:28
-
-
Save alphashuro/62af281d9562f25e604fe595e21c062b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
read -e -p "1password email?: " onepassemail | |
read -e -p "1password domain?: " onepassdomain | |
op account add --address $onepassdomain --email $onepassemail | |
eval $(op signin --account $onepassdomain) | |
# TODO: handle existing private key | |
mkdir -p $HOME/.ssh | |
KEY=$HOME/.ssh/id_rsa | |
touch $KEY | |
chmod 600 $KEY | |
echo "{{ index (onepasswordDetailsFields "SSH Key") "private key" "value" }}" >> $KEY |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment