Skip to content

Instantly share code, notes, and snippets.

@itsamenathan
Created February 2, 2017 17:51
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save itsamenathan/fcd8f5d5ec7e780ffe96ec723d16e766 to your computer and use it in GitHub Desktop.
ssh copy me
#!/bin/bash
set -x
set -e
case "$1" in
start)
echo "start"
USER="$2"
IP="$3"
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $USER@$IP "bash -s" < ./$0 remote "arg1" "arg2"
;;
remote)
echo "remote"
echo "args - > $@"
;;
*)
echo "I don't know what to do here"
exit 1
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment