Ver código fonte

add ssh/scp/rsync wrapper scripts, with bubble port pre-set

tags/v1.4.28
Jonathan Cobb 4 anos atrás
pai
commit
ada888dcd5
3 arquivos alterados com 59 adições e 0 exclusões
  1. +27
    -0
      bin/brsync
  2. +16
    -0
      bin/bscp
  3. +16
    -0
      bin/bssh

+ 27
- 0
bin/brsync Ver arquivo

@@ -0,0 +1,27 @@
#!/bin/bash
#
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://getbubblenow.com/bubble-license/
#
# Wrap rsync with options to use port 1202, the standard Bubble SSH port.
# If your rsync command already contains a `-e` or `--rsh` option, this wrapper will not work.
#
# Environment variables:
#
# BUBBLE_SSH_PORT : If set, this port will be used instead of 1202
#

if [[ -z "${BUBBLE_SSH_PORT}" ]] ; then
BUBBLE_SSH_PORT="1202"
fi

function die() {
echo 1>&2 "${1}"
exit 1
}


if [[ $(echo "${@}" | grep -c -- "-e ") -gt 0 || $(echo "${@}" | grep -c -- "--rsh") -gt 0 ]] ; then
die "$0 does not work correctly when -e or --rsh is used, since it sets its own: ${@}"
fi

rsync -e ''"$(which ssh)"' -p '"${BUBBLE_SSH_PORT}"'' "${@}"

+ 16
- 0
bin/bscp Ver arquivo

@@ -0,0 +1,16 @@
#!/bin/bash
#
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://getbubblenow.com/bubble-license/
#
# Wrap scp with options to use port 1202, the standard Bubble SSH port
#
# Environment variables:
#
# BUBBLE_SSH_PORT : If set, this port will be used instead of 1202
#

if [[ -z "${BUBBLE_SSH_PORT}" ]] ; then
BUBBLE_SSH_PORT="1202"
fi

scp -P ${BUBBLE_SSH_PORT} "${@}"

+ 16
- 0
bin/bssh Ver arquivo

@@ -0,0 +1,16 @@
#!/bin/bash
#
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://getbubblenow.com/bubble-license/
#
# Wrap ssh with options to use port 1202, the standard Bubble SSH port.
#
# Environment variables:
#
# BUBBLE_SSH_PORT : If set, this port will be used instead of 1202
#

if [[ -z "${BUBBLE_SSH_PORT}" ]] ; then
BUBBLE_SSH_PORT="1202"
fi

ssh -p ${BUBBLE_SSH_PORT} "${@}"

Carregando…
Cancelar
Salvar