#!/bin/sh
# umwelt remote relay - the forced-command entrypoint.
#
# This is the executable `authorized_keys` names as its forced command
# (`command="<install dir>/umwelt-relay",restrict,...`). sshd runs that
# command through `$SHELL -c` with the login home as cwd, so this script
# resolves `relay.py` **beside itself** rather than by a relative or PATH
# lookup. The real entrypoint is `relay.py` (pure stdlib); this shim only
# exists because a forced command needs an executable file, and `relay.py`
# is shipped without an executable bit.
#
# All arguments are forwarded. The relay ignores the ssh command line and
# reads its handshake from stdin, so forwarding is belt-and-suspenders.
set -eu
here=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
exec python3 "$here/relay.py" "$@"
