diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2018-07-07 01:23:22 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2018-07-07 01:23:22 -0300 |
commit | 6deabc70ad80fb0da11dde1078380f0af9c5e6f7 (patch) | |
tree | 9f38d8c87efd9367c435292681a899edb31ab857 | |
parent | 007a86a6467da934b19be9b6b365dc443e503432 (diff) | |
download | scripts-6deabc70ad80fb0da11dde1078380f0af9c5e6f7.tar.gz scripts-6deabc70ad80fb0da11dde1078380f0af9c5e6f7.tar.bz2 |
VNC: adds localport and remoteport args
-rwxr-xr-x | vnc | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -6,10 +6,12 @@ # Parameters BASENAME="`basename $0`" SERVER="$1" +LOCALPORT="${2:-5901}" +REMOTEPORT="${3:-5901}" # Check if [ -x "$SERVER" ]; then - echo "usage: $BASENAME <server>" + echo "usage: $BASENAME <server> [localport] [remoteport]" exit 1 fi @@ -31,12 +33,12 @@ EOF # See http://www.g-loaded.eu/2006/11/24/auto-closing-ssh-tunnels/ # Optional SSH compression #ssh -C -c blowfish -f -L 5901:127.0.0.1:5901 $SERVER sleep 10 -ssh -f -L 5901:127.0.0.1:5901 $SERVER sleep 10 +ssh -f -L $LOCALPORT:127.0.0.1:$REMOTEPORT $SERVER sleep 10 # Run VNC client # Copy $SERVER:~/.vnc/passwd into $HOME/.vnc/$SERVER.passwd for passwordless login if [ -e "$HOME/.vnc/$SERVER.passwd" ]; then - vncviewer -passwd $HOME/.vnc/$SERVER.passwd localhost:5901 + vncviewer -passwd $HOME/.vnc/$SERVER.passwd localhost:$LOCALPORT else - vncviewer localhost:5901 + vncviewer localhost:$LOCALPORT fi |