Skip to content

Instantly share code, notes, and snippets.

@rasschaert
Created December 1, 2015 16:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rasschaert/3035dfdaefd6a41301c7 to your computer and use it in GitHub Desktop.
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
#!/bin/bash
if [[ -z $1 ]]; then
echo "Usage: $(basename $0) HOSTNAME" >&2
exit 1
fi
ssh-copy-id $@
ssh-copy-rsub $@
#!/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