#!/bin/sh
pidof ptunnel >/dev/null || ptunnel-client
if [ "$#" -gt 0 ]; then
	shift # get rid of the hostname
fi
count=0
while [ $count -lt 10 ]; do
	ssh -p 2222 localhost "$@"
	if [ $? != 255 ]; then break; fi
	count=$(($count+1))
done
