Create XEN Scalix domain

#!/bin/bash

# !!! Warning !!!
# This script are currently under development and not full testet yet!

# download ubuntu gutsy i386 kernel for domU
wget http://www.panticz.de/sites/default/files/ubuntu-2.6.22-14-xen.i386-kernel.tar.bz2 -P /tmp
tar -Pxjf /tmp/ubuntu-2.6.22-14-xen.i386-kernel.tar.bz2

DOMAIN_NAME=sx

xen-create-image --hostname=$DOMAIN_NAME --ip=192.168.1.231 --gateway=192.168.1.5 --netmask=255.255.255.0 \
--dir=/home/xen --dist=feisty --mirror=http://archive.ubuntu.com/ubuntu/ --arch=i386 \
--size=4Gb --memory=1024Mb --swap=1024Mb \
--kernel=/boot/vmlinuz-2.6.22-14-xen.i386 --initrd=/boot/initrd.img-2.6.22-14-xen.i386

cp /etc/xen/$DOMAIN_NAME.cfg /etc/xen/$DOMAIN_NAME.cfg.org
sed -i 's|file:|tap:aio:|g' /etc/xen/$DOMAIN_NAME.cfg
mv /etc/xen/$DOMAIN_NAME.cfg /etc/xen/$DOMAIN_NAME

# todo, install kernel modules
# mount /home/xen/domains/$DOMAIN_NAME/disk.img /mnt -o loop
# copy
# umount /mnt/

xm create -c $DOMAIN_NAME

apt-get install wget
wget http://downloads.scalix.com/.community/11.3-U1/scalix-11.3.0-U1-GA-unsupported-debian-intel.bin -P /tmp/
chmod +x /tmp/scalix-11.3.0-U1-GA-unsupported-debian-intel.bin

wget http://ti.dynalias.net/dl/py/pyscalix.zip -P /tmp/
cd /tmp
apt-get install unzip
unzip pyscalix.zip
python scalix_install_deb.py

# Calendar URL for Lightning
# http:///api/dav/Calendars/Users/@/Calendar

# Links
# http://ti.dynalias.net/rd/programming/py/scalix_inst.aspx
# http://www.scalix.com/wiki/index.php?title=TB/TB-2008-01-CALDAV