Created
December 1, 2015 16:30
-
-
Save rasschaert/3035dfdaefd6a41301c7 to your computer and use it in GitHub Desktop.
script that copies over rmate to a host and creates a wrapper called rsub
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 | |
if [[ -z $1 ]]; then | |
echo "Usage: $(basename $0) HOSTNAME" >&2 | |
exit 1 | |
fi | |
ssh-copy-id $@ | |
ssh-copy-rsub $@ |
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 | |
if [[ -z $1 ]]; then | |
echo "Usage: $(basename $0) HOSTNAME" >&2 | |
exit 1 | |
fi | |
rmate=/usr/local/bin/rmate | |
rsub=/usr/local/bin/rsub | |
cat /usr/local/bin/rmate | ssh $1 "cat > $rmate ; chmod +x $rmate ; printf '%s\n%s\n' '#!/bin/bash' 'RMATE_PORT=52700 rmate \$@' > $rsub ;chmod +x $rsub" | |
echo 'rsub+rmate copied' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment