#!/bin/bash

#This script opens a VNC connection in gvncviewer. The URL is in the format
#vnc://host:display

if [ ! "$1" ]
then
	echo "no URL provided" >&2
	exit 1
fi

if ! echo "$1" | grep -q '^vnc://'
then
	echo "URL does not start with vnc://" >&2
	exit 1
fi

gvncviewer_args="`echo $1 | sed 's_vnc://__'`"

exec xtigervncviewer "$gvncviewer_args"
