#!/usr/bin/ksh

DOMAIN_NAME="centos1"
DOMAIN_IP="192.168.178.115"

echo "Starting the Xen Domain \"${DOMAIN_NAME}\" ..."
gnome-terminal --title "Xen - ${DOMAIN_NAME} console" --command "xm create -c  /export/xen-images/${DOMAIN_NAME}.phy" 

echo "Waiting for the domain to come up ..."
while [ 0 = 0 ] ; do
  echo ".\c"
  ping ${DOMAIN_IP}
  [ $? -eq 0 ] && break
  sleep 1
done
sleep 5
echo ""
echo "Starting the VNC viewer for \"${DOMAIN_IP}\" ..."  
/opt/sfw/bin/vncviewer ${DOMAIN_IP}:5900 &

