]> gitweb.fluxo.info Git - scripts.git/commitdiff
VNC: instructions
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 28 Jun 2020 16:57:36 +0000 (13:57 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 28 Jun 2020 16:57:36 +0000 (13:57 -0300)
vnc

diff --git a/vnc b/vnc
index 2b190f7e1553b48a0bf00dfa3fcfb6be6756ccca..94ce3d6cb2cfa43e8220fa30ef37daf675e3eec1 100755 (executable)
--- a/vnc
+++ b/vnc
@@ -15,13 +15,39 @@ REMOTEPORT="${3:-5901}"
 # This is probably a bug on xtigervncviewer
 VIEWER_OPTS="-AcceptClipboard=off -SendClipboard=off -SetPrimary=off -SendPrimary=off"
 
+function usage {
+  echo "usage: $BASENAME <server> [localport] [remoteport]"
+  cat <<EOF
+
+setup instructions
+==================
+
+* in the remote:
+
+  sudo apt install tigervnc-standalone-server # install in the remote server
+  vncpasswd                                   # generate a ~/.vnc/passwd in the remote server
+
+* in the local box:
+
+  scp <server>:~/.vnc/passwd ~/.vnc/<server>.passwd # copy the secret
+  $BASENAME <server>                                      # use our magic script to do everything else
+
+EOF
+
+  exit 1
+}
+
+# Usage
+if [ "$1" == "--help" ]; then
+  usage
+fi
+
 # Check
 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
+    usage
   fi
 fi