Last active
October 17, 2022 09:55
-
-
Save mtovmassian/238d5488bac78430cf7242abff3eea71 to your computer and use it in GitHub Desktop.
Qick ssh key adding to ssh-agent
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
#!/usr/bin/env bash | |
main() { | |
ssh_key_path="${1}" | |
if [[ -z $ssh_key_path ]] | |
then usage; exit | |
fi | |
ssh-add "${ssh_key_path}" | |
ssh-agent | |
} | |
usage() { | |
echo "Usage:" | |
echo "go-ssh-agent.sh </path/to/ssh/private/key>" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment