Commit 3516bdf3 authored by Joel Martin's avatar Joel Martin

util/launch.sh: add --web option and try /usr/share/novnc

parent 51562999
...@@ -16,6 +16,8 @@ usage() { ...@@ -16,6 +16,8 @@ usage() {
echo " Default: localhost:5900" echo " Default: localhost:5900"
echo " --cert CERT Path to combined cert/key file" echo " --cert CERT Path to combined cert/key file"
echo " Default: self.pem" echo " Default: self.pem"
echo " --web WEB Path to web files (e.g. vnc.html)"
echo " Default: ./"
exit 2 exit 2
} }
...@@ -24,6 +26,7 @@ HERE="$(cd "$(dirname "$0")" && pwd)" ...@@ -24,6 +26,7 @@ HERE="$(cd "$(dirname "$0")" && pwd)"
PORT="6080" PORT="6080"
VNC_DEST="localhost:5900" VNC_DEST="localhost:5900"
CERT="" CERT=""
WEB=""
proxy_pid="" proxy_pid=""
die() { die() {
...@@ -50,6 +53,7 @@ while [ "$*" ]; do ...@@ -50,6 +53,7 @@ while [ "$*" ]; do
--listen) PORT="${OPTARG}"; shift ;; --listen) PORT="${OPTARG}"; shift ;;
--vnc) VNC_DEST="${OPTARG}"; shift ;; --vnc) VNC_DEST="${OPTARG}"; shift ;;
--cert) CERT="${OPTARG}"; shift ;; --cert) CERT="${OPTARG}"; shift ;;
--web) WEB="${OPTARG}"; shift ;;
-h|--help) usage ;; -h|--help) usage ;;
-*) usage "Unknown chrooter option: ${param}" ;; -*) usage "Unknown chrooter option: ${param}" ;;
*) break ;; *) break ;;
...@@ -66,12 +70,18 @@ netstat -ltn | grep -qs "${PORT} .*LISTEN" \ ...@@ -66,12 +70,18 @@ netstat -ltn | grep -qs "${PORT} .*LISTEN" \
trap "cleanup" TERM QUIT INT EXIT trap "cleanup" TERM QUIT INT EXIT
# Find vnc.html # Find vnc.html
if [ -e "$(pwd)/vnc.html" ]; then if [ -n "${WEB}" ]; then
if [ ! -e "${WEB}/vnc.html" ]; then
die "Could not find ${WEB}/vnc.html"
fi
elif [ -e "$(pwd)/vnc.html" ]; then
WEB=$(pwd) WEB=$(pwd)
elif [ -e "${HERE}/../vnc.html" ]; then elif [ -e "${HERE}/../vnc.html" ]; then
WEB=${HERE}/../ WEB=${HERE}/../
elif [ -e "${HERE}/vnc.html" ]; then elif [ -e "${HERE}/vnc.html" ]; then
WEB=${HERE} WEB=${HERE}
elif [ -e "${HERE}/../share/novnc/vnc.html" ]; then
WEB=${HERE}/../share/novnc/
else else
die "Could not find vnc.html" die "Could not find vnc.html"
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment