Created
December 19, 2021 09:13
-
-
Save wdhg/466d4f6bdf5b8eb488aa233a19c5a50c 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
| function sss() { | |
| if pgrep ssh-agent &> /dev/null; then | |
| echo "ssh-agent already running. Do you want to restart it? [Y/n]" | |
| read -rs -k 1 Res | |
| case "${Res}" in | |
| n|N) | |
| return 0 | |
| ;; | |
| *) | |
| pkill -9 ssh-agent | |
| esac | |
| fi | |
| eval "$(ssh-agent)" && ssh-add | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment