From 1253a53c4434ccc5c8a2ae7efc0648344c0a072b Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Mon, 11 Mar 2019 15:07:37 -0300 Subject: VNC: support for a default server --- vnc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/vnc b/vnc index 527b785..2b190f7 100755 --- a/vnc +++ b/vnc @@ -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 [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 [localport] [remoteport]" + exit 1 + fi fi # Check if vncserver is running in the remote server and start otherwise -- cgit v1.2.3