diff options
-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 |