Skip to content

Instantly share code, notes, and snippets.

@wdhg
Created December 19, 2021 09:13
Show Gist options
  • Select an option

  • Save wdhg/466d4f6bdf5b8eb488aa233a19c5a50c to your computer and use it in GitHub Desktop.

Select an option

Save wdhg/466d4f6bdf5b8eb488aa233a19c5a50c to your computer and use it in GitHub Desktop.
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