Created
October 14, 2016 09:03
-
-
Save koara-local/a3f8506f7215f29dca78c997e043881d to your computer and use it in GitHub Desktop.
This file contains hidden or 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/bash -eu | |
| if [ ! -e ~/.ssh/id_rsa_gitlab ]; then | |
| ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa_gitlab | |
| fi | |
| if [ ! -e ~/.ssh/config ] || [ $(cat ~/.ssh/config | grep github | wc -l) == 0 ]; then | |
| cat << EOS >> ~/.ssh/config | |
| Host github github.com | |
| User git | |
| Hostname github.com | |
| Port 22 | |
| IdentityFile ~/.ssh/id_rsa_github | |
| EOS | |
| fi | |
| echo -e "please, Adding a new SSH key to your GitHub account\n" | |
| cat ~/.ssh/id_rsa_gitlab.pub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment