Browse code

pull DIST_NAME from source

Jesse Andrews authored on 2011/11/07 00:54:11
Showing 1 changed files
... ...
@@ -1,8 +1,5 @@
1 1
 #!/usr/bin/env bash
2 2
 
3
-# Ubuntu distro to install
4
-DIST_NAME=${DIST_NAME:-oneiric}
5
-
6 3
 # Make sure that we have the proper version of ubuntu (only works on natty/oneiric)
7 4
 UBUNTU_VERSION=`cat /etc/lsb-release | grep CODENAME | sed 's/.*=//g'`
8 5
 if [ ! "oneiric" = "$UBUNTU_VERSION" ]; then
... ...
@@ -16,6 +13,14 @@ fi
16 16
 TOOLS_DIR=$(cd $(dirname "$0") && pwd)
17 17
 TOP_DIR=`cd $TOOLS_DIR/..; pwd`
18 18
 
19
+cd $TOP_DIR
20
+
21
+# Source params
22
+source ./stackrc
23
+
24
+# Ubuntu distro to install
25
+DIST_NAME=${DIST_NAME:-oneiric}
26
+
19 27
 # exit on error to stop unexpected errors
20 28
 set -o errexit
21 29
 set -o xtrace
... ...
@@ -49,10 +54,6 @@ if [ ! -f $tarball ]; then
49 49
     cp $image_dir/*-vmlinuz-virtual $image_dir/kernel
50 50
 fi
51 51
 
52
-cd $TOP_DIR
53
-
54
-# Source params
55
-source ./stackrc
56 52
 
57 53
 # Configure the root password of the vm to be the same as ``ADMIN_PASSWORD``
58 54
 ROOT_PASSWORD=${ADMIN_PASSWORD:-password}