Skip to content

Instantly share code, notes, and snippets.

@guangrei
Created February 8, 2021 09:18
Show Gist options
  • Save guangrei/310c2bf7047c20f76a21197f854c9bfd to your computer and use it in GitHub Desktop.
Save guangrei/310c2bf7047c20f76a21197f854c9bfd to your computer and use it in GitHub Desktop.
#!/bin/bash
KEYS=$1
CMDS=$2
if [ $# -eq 0 ] ; then
echo "No arguments supplied"
echo "Usage: command KEY CMD"
exit 1
fi
ssh-agent bash -c 'ssh-add $KEYS; $CMDS'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment