Created
February 2, 2017 17:51
-
-
Save itsamenathan/fcd8f5d5ec7e780ffe96ec723d16e766 to your computer and use it in GitHub Desktop.
ssh copy me
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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