qusal/salt/sys-ssh-agent/files/server/rpc/qusal.SshAgent
2023-11-13 14:33:28 +00:00

15 lines
335 B
Bash

#!/bin/sh
# SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <ben.grande.b@gmail.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
set -eu
#origin="$QREXEC_REMOTE_DOMAIN"
agent="$QREXEC_SERVICE_ARGUMENT"
socket="/tmp/qubes-ssh-agent/${agent}.sock"
qvm-ssh-agent add "${agent}" >/dev/null
exec socat STDIO UNIX-CLIENT:"$socket"