aboutsummaryrefslogtreecommitdiff
path: root/ssh-tunnel-all
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukasz.kasprzak@pm.me>2026-04-13 17:37:26 +0200
committerLukasz Kasprzak <lukasz.kasprzak@pm.me>2026-04-13 17:37:26 +0200
commit51d43498b07dc97d795947964534f0903cd05db5 (patch)
tree735712bd50b5c244ef922a3b873c709ecce604cd /ssh-tunnel-all
parent39711cf6c2ec5a3b4480dcb4800cc3802bda5bf2 (diff)
downloadbin-51d43498b07dc97d795947964534f0903cd05db5.tar.gz
bin-51d43498b07dc97d795947964534f0903cd05db5.zip
routine backup
Diffstat (limited to 'ssh-tunnel-all')
-rwxr-xr-xssh-tunnel-all31
1 files changed, 31 insertions, 0 deletions
diff --git a/ssh-tunnel-all b/ssh-tunnel-all
new file mode 100755
index 0000000..9c35202
--- /dev/null
+++ b/ssh-tunnel-all
@@ -0,0 +1,31 @@
+#!/usr/bin/env zsh
+set -euo pipefail
+
+SOCK="${XDG_RUNTIME_DIR:-/tmp}/sanctum-all.sock"
+HOST="lukasz@192.168.33.5"
+PORT="57385"
+
+if [[ -S "$SOCK" ]]; then
+ if ssh -S "$SOCK" -O check -p "$PORT" "$HOST" >/dev/null 2>&1; then
+ echo "Tunnel already running"
+ exit 0
+ else
+ rm -f "$SOCK"
+ fi
+fi
+
+ssh -fN \
+ -M \
+ -S "$SOCK" \
+ -p "$PORT" \
+ -L 127.0.0.1:18080:127.0.0.1:8080 \
+ -L 127.0.0.1:8502:127.0.0.1:8502 \
+ -L 127.0.0.1:5055:127.0.0.1:5055 \
+ -L 127.0.0.1:8000:127.0.0.1:8000 \
+ -L 127.0.0.1:4444:127.0.0.1:4444 \
+ -L 127.0.0.1:7070:127.0.0.1:7070 \
+ -L 127.0.0.1:7659:127.0.0.1:7659 \
+ -L 127.0.0.1:7660:127.0.0.1:7660 \
+ "$HOST"
+
+echo "Tunnel started"