From adf91a1ca9e976fcdfa973a3742d8152378c04b4 Mon Sep 17 00:00:00 2001 From: Mahesh Asolkar Date: Sat, 1 Sep 2018 18:35:01 -0700 Subject: [PATCH] New script to start VNC --- startvnc | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 startvnc diff --git a/startvnc b/startvnc new file mode 100755 index 0000000..93e8276 --- /dev/null +++ b/startvnc @@ -0,0 +1,40 @@ +#!/bin/bash + +OPTS=`getopt -o hn:c:p: --long help,name:,color:,port: -n 'parse-options' -- "$@"` + +if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi + +eval set -- "$OPTS" + +HELP=false +NAME=$(hostname) +COLOR="837642" +PORT=63 + +while true; do + case "$1" in + -h | --help ) HELP=true; shift ;; + -n | --name ) NAME="$2"; shift; shift ;; + -c | --color ) COLOR="$2"; shift; shift ;; + -p | --port ) PORT="$2"; shift; shift ;; + -- ) shift; break ;; + * ) break ;; + esac +done + +if ${HELP}; then + cat <