- #retreive and install lxc from sources
- isInstalled=$(lxc-version | cut -d: -f2 | grep "0.8.0-rc1")
- if [ -z "$isInstalled" ] ; then
- echo "Installing lxc ..."
- cd /root
- git clone git://lxc.git.sourceforge.net/gitroot/lxc/lxc
- cd lxc
- ./autogen.sh
- ./configure
- make
- make install
- fi
-
- #create a symlink (just a hack to make lxc works)
- [ ! -d "/usr/local/var/lib" ] && mkdir -p /usr/local/var/lib
- #[ ! -f "/usr/local/var/lib/lxc" ] && ln -s /var/lib/lxc /usr/local/var/lib/lxc
+function prepare_host() {
+
+ host_fcdistro="$(cat /etc/fedora-release | cut -d' ' -f3)"
+ ## check if libvirt_version is installed
+ virsh -v | grep -e $libvirt_version || { echo "$libvirt_version needs to be installed!!!" ; exit 1 ; }
+# host_fcdistro="$(cat /etc/fedora-release | cut -d' ' -f3)"
+# if [ ! -f /etc/yum.repos.d/libvirt.repo ] ; then
+# touch /etc/yum.repos.d/libvirt.repo
+# cat <<EOF > /etc/yum.repos.d/libvirt.repo
+#[libvirt]
+#name=libvirt-1.0.2-1
+#baseurl=http://build.onelab.eu/lxc/2013.02.25--lxc$host_fcdistro/RPMS/
+#enabled=1
+#gpgcheck=0
+#EOF
+#
+# yum --assumeno update
+# check_yumgroup_installed "Development Tools"
+# check_yum_installed libcap-devel
+# check_yum_installed libvirt
+# systemctl start libvirtd
+# fi
+
+ #################### bride initialization
+ check_yum_installed bridge-utils
+ #Bridge init
+ isInstalled=$(netstat -rn | grep '^0.0.0.0' | awk '{print $8;}')
+ if [ "$isInstalled" != "br0" ] ; then
+ bridge_init
+ sleep 5
+ fi