Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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