summaryrefslogtreecommitdiffstats
path: root/environments/vncserver-ssh-socket-forward/run.sh
diff options
context:
space:
mode:
Diffstat (limited to 'environments/vncserver-ssh-socket-forward/run.sh')
-rw-r--r--environments/vncserver-ssh-socket-forward/run.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/environments/vncserver-ssh-socket-forward/run.sh b/environments/vncserver-ssh-socket-forward/run.sh
new file mode 100644
index 0000000..f807d25
--- /dev/null
+++ b/environments/vncserver-ssh-socket-forward/run.sh
@@ -0,0 +1,25 @@
+if ! type podman > /dev/null; then
+ if ! type docker > /dev/null; then
+ echo "Install podman or docker to use the remmina environments!"
+ exit 1
+ fi
+ CRT=docker
+else
+ CRT=podman
+fi
+
+CONTAINER_NAME="vncserver-ssh-socket-forward"
+
+$CRT stop "${CONTAINER_NAME}"
+$CRT rm "${CONTAINER_NAME}"
+
+$CRT build . -t remmina/test-server:latest
+
+rm -f "${PWD}/vnc-server-tmp/vnc.socket"
+rm -f "${PWD}/vnc-server-tmp/forwarded.socket"
+
+$CRT run -d -p 2222:2222 -v "${PWD}/ssh_key.pub:/root/.ssh/authorized_keys:rw" -v "${PWD}/vnc-server-tmp:/vnc-server-tmp:rw" --rm --name "${CONTAINER_NAME}" -t remmina/test-server:latest
+
+sleep 5
+
+ssh -i "${PWD}/ssh_key" -o "LocalForward=${PWD}/vnc-server-tmp/forwarded.socket /vnc-server-tmp/vnc.socket" -o StreamLocalBindUnlink=yes -o ExitOnForwardFailure=yes root@localhost -p 2222