#!/bin/sh # This file is part of Epoptes, https://epoptes.org # Copyright 2017-2018 the Epoptes team, see AUTHORS. # SPDX-License-Identifier: GPL-3.0-or-later usage() { printf "Usage: $0 host[:port]\n%s" \ ' Share the current terminal with a remote person over a secure connection. ' } die() { printf "%s\n" "$@" >&2 exit 1 } test -n "$1" || die "$(usage)" command -v socat >/dev/null 2>&1 || die "Please install socat." command -v screen >/dev/null 2>&1 || die "Please install screen." case "$1" in *:*) host=$1 ;; *) host=$1:5499 ;; esac printf "Connecting to $host..." read LINES COLUMNS <