diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2019-03-11 15:07:37 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2019-03-11 15:07:37 -0300 |
commit | 1253a53c4434ccc5c8a2ae7efc0648344c0a072b (patch) | |
tree | 7b17b178962cb872c79104e0ad037209caac06b8 | |
parent | 177bfdd43ceb3968e525d5c69778f403a4910907 (diff) | |
download | scripts-1253a53c4434ccc5c8a2ae7efc0648344c0a072b.tar.gz scripts-1253a53c4434ccc5c8a2ae7efc0648344c0a072b.tar.bz2 |
VNC: support for a default server
-rwxr-xr-x | vnc | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -16,9 +16,13 @@ REMOTEPORT="${3:-5901}" VIEWER_OPTS="-AcceptClipboard=off -SendClipboard=off -SetPrimary=off -SendPrimary=off" # Check -if [ -x "$SERVER" ]; then - echo "usage: $BASENAME <server> [localport] [remoteport]" - exit 1 +if [ -z "$SERVER" ]; then + if [ -h "$HOME/.vnc/default.passwd" ]; then + SERVER="$(basename `readlink $HOME/.vnc/default.passwd` .passwd)" + else + echo "usage: $BASENAME <server> [localport] [remoteport]" + exit 1 + fi fi # Check if vncserver is running in the remote server and start otherwise |