Skip to content

Instantly share code, notes, and snippets.

@zsteva
Last active May 26, 2016 08:22
Show Gist options
  • Save zsteva/221b9000d555759770a8e65f83812f21 to your computer and use it in GitHub Desktop.
Save zsteva/221b9000d555759770a8e65f83812f21 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ -z "$SSH_AGENT_PID" ]; then
echo "no ssh agent"
ssh-agent "$0" "$@"
exit $?
fi
set -e -x
ssh-add ~/.ssh/id_rsa
ssh host command1
ssh host command2
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment