uncommited
This commit is contained in:
@@ -5,7 +5,7 @@ if [ $# -lt 1 ]; then
|
||||
exit 1
|
||||
fi
|
||||
[ -z "$WSCOMPAT_MASTER" ] && WSCOMPAT_MASTER="$(whoami)"
|
||||
read -r -d '' init_cmd << EOF_9oqn7IVF
|
||||
read -r -d '' init_cmd << WSCOMPAT_EOF_9oqn7IVF
|
||||
export WS_IS_COMPAT=1
|
||||
export WSCOMPAT_MASTER="$WSCOMPAT_MASTER"
|
||||
export WSCOMPAT_DIR="/tmp/wscompat_${WSCOMPAT_MASTER}_\$(whoami)"
|
||||
@@ -14,18 +14,20 @@ read -r -d '' init_cmd << EOF_9oqn7IVF
|
||||
trap ws_cleanup EXIT
|
||||
rm -rf "\$WSCOMPAT_DIR" && mkdir -p "\$WSCOMPAT_DIR" && chmod 700 "\$WSCOMPAT_DIR"
|
||||
|
||||
cat << 'EOF_84EbM3la' > "\$WSCOMPAT_DIR/profile"
|
||||
cat << 'WSCOMPAT_EOF_84EbM3la' > "\$WSCOMPAT_DIR/profile"
|
||||
$(
|
||||
cat "$WSCOMPAT_DIR/profile"
|
||||
sed 's/WSCOMPAT_EOF_/WSCOMPAT_EOF__/g' "$WSCOMPAT_DIR/profile"
|
||||
for file in "$WSCOMPAT_DIR.profile"*.sh; do
|
||||
if [ -f "$file" ]; then cat "$file"; fi
|
||||
if [ -f "$file" ]; then
|
||||
sed 's/WSCOMPAT_EOF_/WSCOMPAT_EOF__/g' "$file"
|
||||
fi
|
||||
done
|
||||
)
|
||||
EOF_84EbM3la
|
||||
WSCOMPAT_EOF_84EbM3la
|
||||
. \$WSCOMPAT_DIR/profile
|
||||
|
||||
# pam, systemd - wrap in login shell
|
||||
exec /bin/bash --login --norc --noprofile -c "exec /bin/bash"
|
||||
EOF_9oqn7IVF
|
||||
WSCOMPAT_EOF_9oqn7IVF
|
||||
|
||||
ssh -t "$@" "$init_cmd"
|
||||
/bin/ssh -t "$@" "$init_cmd"
|
||||
|
||||
Reference in New Issue
Block a user