#!/bin/bash
#
#This script opens a pterm connection to a DtCyber instance running PLATO. The
#URL is of the form plato://<host>[:port]

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

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

pterm_args="`echo $1 | sed 's_plato://__' | tr ':' ' '`"

exec pterm $pterm_args
