aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2020-06-28 13:57:36 -0300
committerSilvio Rhatto <rhatto@riseup.net>2020-06-28 13:57:36 -0300
commit3311f24e9ccb74944e2a74e15aeaaeed9edef81f (patch)
tree0a41b319430cdf31a4230db5bc360a38053004e9
parent7a6b5da5ee4ae3da92a8ebf56773d62c7518dafd (diff)
downloadscripts-3311f24e9ccb74944e2a74e15aeaaeed9edef81f.tar.gz
scripts-3311f24e9ccb74944e2a74e15aeaaeed9edef81f.tar.bz2
VNC: instructions
-rwxr-xr-xvnc30
1 files changed, 28 insertions, 2 deletions
diff --git a/vnc b/vnc
index 2b190f7..94ce3d6 100755
--- 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