diff options
Diffstat (limited to 'dbx-proxy')
| -rwxr-xr-x | dbx-proxy | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/dbx-proxy b/dbx-proxy new file mode 100755 index 0000000..67e0456 --- /dev/null +++ b/dbx-proxy @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: GPL-3.0-only + +set -euo pipefail + +if [[ $# -ne 1 ]]; then + echo "ERROR: missing port to proxy" >&2 + exit 1 +fi + +root="$(dirname "$(realpath "${BASH_SOURCE[0]}")")" +machine="${DBX_MACHINE:-dbx}" +port="$1" + +"$root/dbx-start" +exec ssh "$machine" -F "$root/ssh/$machine.config" \ + -L "localhost:$port:localhost:$port" -N |
