Last active
April 30, 2024 01:53
-
-
Save mjkramer/9936b6d30e5d9d5abe4368bffff438b3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
host=login12 | |
port=12345 | |
oldTunnel=$(ps ux | grep ssh | grep "\\-L $port") | |
if [[ -n "$oldTunnel" ]]; then | |
pid=$(echo "$oldTunnel" | awk '{print $2}') | |
kill "$pid" | |
fi | |
ssh -Nf -L $port:$host:$port saul.nersc.gov | |
xpra attach tcp://localhost:$port |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment