+#install the packages needed
+sudo apt-add-repository ppa:maas-deployers/stable -y
+sudo apt-add-repository ppa:juju/stable -y
+sudo apt-add-repository ppa:maas/stable -y
+sudo apt-add-repository cloud-archive:liberty -y
+sudo apt-get update -y
+sudo apt-get dist-upgrade -y
+sudo apt-get install openssh-server git maas-deployer juju juju-deployer maas-cli python-pip python-openstackclient gsutil -y
+
+cp maas/deployment.yaml ./deployment.yaml
+
+#first parameter should be custom and second should be either
+# absolute location of file (including file name) or url of the
+# file to download.
+
+if [ "$1" == "custom" ]; then
+ if [ -e $2 ]; then
+ cp $2 ./labconfig.yaml || true
+ python deploy.py
+ else
+ wget $2 -t 3 -T 10 -O ./labconfig.yaml || true
+ count=`wc -l labconfig.yaml | cut -d " " -f 1`
+
+ if [ $count -lt 10 ]; then
+ rm -rf labconfig.yaml
+ else
+ python deploy.py
+ fi
+ fi
+
+ if [ ! -e ./labconfig.yaml ]; then
+ virtinstall=1
+ cp ../labconfig/default/labconfig.yaml ./
+ python deploy.py
+ fi
+fi
+
+exit 1
+