#!/bin/bash

if [ "${1#*\:\/\/}" != "${1}" ]; then
withoutprotocol="${1#*\:\/\/}"
result="${withoutprotocol##*\/}"
if [ "$result" != ${withoutprotocol} ]; then
   params="$result"
fi
result="${withoutprotocol%%\/*}"
if [ "$result" != "" ]; then
   address="$result"
   hostname="${address%%\:*}"
   result=${address##*\:}
   if [ "$result" != ${address} ]; then
      port="$result"
   fi
fi
result="${address%%\:*}"
if [ "$result" != ${address} ]; then
    hostname="$result"
fi
result=${address##*\:}
if [ "$result" != ${address} ]; then
   port="$result"
fi

if [ "$port" != "" ]; then

   port_arg="--port $port"
fi

if [ "$hostname" != "" ]; then

   hostname_arg="--host $hostname"
fi

fi
tao-network-client $hostname_arg $port_arg

