From c1ce7d16e0dffb5f7974d7aff6bd9e99dd81496e Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 26 May 2026 08:58:10 +0200 Subject: [PATCH] add first version of remote access --- remote-access.sh | 59 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100755 remote-access.sh diff --git a/remote-access.sh b/remote-access.sh new file mode 100755 index 0000000..7a84240 --- /dev/null +++ b/remote-access.sh @@ -0,0 +1,59 @@ +#!/bin/sh +# Nico Schottelius, 2026-05-26 + +if [ $# -ne 1 ] ; then + echo $0 hostname.ra.placeX.ungleich.ch + exit 1 +fi + +target_host=$1; shift + +case $target_host in + *.ra.place10.ungleich.ch) + jump="vigir26.place10.ungleich.ch" + #jump="vigir26.place10.ungleich.ch vigir23.place10.ungleich.ch" + ;; + *) + echo "Unsupported RA access" >&2 + exit 1 +esac + +set -x + +if ! docker ps --format '{{.Names}}' | grep -q "^old-firefox$"; then + echo "Starting old firefox in docker in background" + docker run -ti --rm --net=host --name old-firefox -d \ + -v ~/.old-firefox:/root/.mozilla ungleich/firefox-java-vnc +else + echo "Old firefox already running" +fi + +echo "Trying to create socks proxy on localhost:3133 (might fail if running already)" +for jhost in $jump; do + if ping -c2 $jhost; then + ssh -D 3133 -f -N -T root@$jhost + if [ $? -eq 0 ]; then break; fi + fi +done + +docker exec -d old-firefox firefox $target_host + +vncviewer localhost:0 + +cat <