#!/bin/sh
#
# Example setup of a dhcp veth VPS
#
# Starfry, 26th July 2009
#
vzctl create 123 --ostemplate ubuntu-8.04-i386-minimal
vzctl set 123 --hostname vz123 --save
echo "CONFIG_CUSTOMIZED=\"yes\"" >> /etc/vz/conf/123.conf
echo "VZHOSTBR=\"${BRIDGE:-br0}\"" >> /etc/vz/conf/123.conf
vzctl set 123 --netif_add eth0 --save
cat > /vz/private/123/etc/network/interfaces << EOF
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
EOF
#
# The below is just to test the setup
#
vzctl start 123
sleep 30 # give dhcp a chance to initialise
cp /etc/apt/sources.list /vz/root/123/etc/apt
vzctl exec 123 apt-get update
vzctl exec 123 apt-get install ssmping
