commit cc4e74d910fadc350d0164266a3f395d98563346
parent 3733a29db04f6468c673b4d65988d49dd544888b
Author: Henry Unite <unitehenry@gmail.com>
Date: Wed, 1 Jul 2026 04:29:36 +0000
feat: tunnel host param
Diffstat:
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/scripts/connect b/scripts/connect
@@ -2,6 +2,8 @@
set -euo pipefail
+export TUNNEL_HOST="${TUNNEL_HOST:-}"
+
declare -a PIDS
cleanup() {
@@ -28,7 +30,9 @@ PIDS+=($!)
./scripts/virtual &
PIDS+=($!)
-./scripts/tunnel &
-PIDS+=($!)
+if [ -n "$TUNNEL_HOST" ]; then
+ ./scripts/tunnel &
+ PIDS+=($!)
+fi
sleep infinity
diff --git a/scripts/tunnel b/scripts/tunnel
@@ -2,6 +2,10 @@
set -euo pipefail
+if [ -z "${TUNNEL_HOST:-}" ]; then
+ exit 0
+fi
+
declare -a SSH_PIDS
cleanup() {
@@ -16,10 +20,10 @@ cleanup() {
trap cleanup EXIT
-ssh -N -R 8080:127.0.0.1:8080 root@142.93.14.238 &
+ssh -N -R 8080:127.0.0.1:8080 "$TUNNEL_HOST" &
SSH_PIDS+=($!)
-ssh -N -R 4090:127.0.0.1:4090 root@142.93.14.238 &
+ssh -N -R 4090:127.0.0.1:4090 "$TUNNEL_HOST" &
SSH_PIDS+=($!)
sleep infinity