#!/bin/bash

containerid=$1
dev_containerd=$2

domid=`xl list $containerid | tail -n 1 | awk '{print $2}'`
dev_xen=$(xenstore-read /local/domain/${domid}/console/tty)
socat \
	PTY,link=${dev_containerd},rawer \
	${dev_xen},rawer
