Created
September 30, 2013 07:52
-
-
Save Overbryd/6760582 to your computer and use it in GitHub Desktop.
A simple script that you can use in your shebang to remote execute local scripts.
This file contains 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 | |
# Usage: | |
# Put this thing as a shebang into your scripts | |
# i.e.: | |
# | |
# #!/bin/ssh_bash user@your-server.com | |
# | |
# echo "hello world from ${hostname}" | |
# | |
login=$1 | |
script=$2 | |
args=${@#$1} | |
args=${args#$2} | |
tar cz $script | ssh $login "tar xz && bash --login $script $args" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment