This commit is contained in:
2025-09-29 20:39:27 +00:00
parent a833ef01eb
commit b5a41d9ae0
2 changed files with 22 additions and 11 deletions

View File

@@ -1,11 +1,17 @@
#!/bin/bash
set -e
if [ ! -t 0 ]; then
exec /bin/ssh "$@"
fi
if [ $# -lt 1 ]; then
echo "Usage: $0 <hostname> [ssh-options]"
exit 1
fi
[ -z "$WSCOMPAT_MASTER" ] && WSCOMPAT_MASTER="$(whoami)"
read -r -d '' init_cmd << WSCOMPAT_EOF_9oqn7IVF
read -r -d '' init_cmd << WSCOMPAT_EOF_9oqn7IVF || true
export WS_IS_COMPAT=1
export WSCOMPAT_MASTER="$WSCOMPAT_MASTER"
export WSCOMPAT_DIR="/tmp/wscompat_${WSCOMPAT_MASTER}_\$(whoami)"
@@ -27,7 +33,7 @@ WSCOMPAT_EOF_84EbM3la
. \$WSCOMPAT_DIR/profile
# pam, systemd - wrap in login shell
exec /bin/bash --login --norc --noprofile -c "exec /bin/bash"
exec /bin/bash --login --norc --noprofile -c "exec /bin/bash --rcfile \"\$WSCOMPAT_DIR/bashrc\""
WSCOMPAT_EOF_9oqn7IVF
/bin/ssh -t "$@" "$init_cmd"
exec /bin/ssh -t "$@" "$init_cmd"