summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Ipsum <richard.ipsum@codethink.co.uk>2015-03-04 11:35:04 +0000
committerRichard Ipsum <richard.ipsum@codethink.co.uk>2015-03-04 11:35:04 +0000
commit4da02bf322bc1b259076664b528b7419772c0f43 (patch)
tree5a84f844aad6840def300fc032b3e90d58f14742
parent49560de3f800c14f0adde9548ad170ae3dc56883 (diff)
downloaddefinitions-4da02bf322bc1b259076664b528b7419772c0f43.tar.gz
openstack.configure: Use $ROOT
-rw-r--r--openstack.configure6
1 files changed, 4 insertions, 2 deletions
diff --git a/openstack.configure b/openstack.configure
index a8ae5554..33184290 100644
--- a/openstack.configure
+++ b/openstack.configure
@@ -25,6 +25,8 @@ set -u
#
# TODO: ipv6
+ROOT="$1"
+
octet='\(\(2[0-5]\?[0-5]\?\)\|\(1[0-9]\?[0-9]\?\)\|\([0-9]\)\)'
valid_ip() {
@@ -46,7 +48,7 @@ append_host() {
if ! valid_ip "$ip"; then echo "ip, '$ip'" is malformed >&2; exit 1; fi
if ! valid_hostname "$hostname"; then echo "hostname, '$hostname'" is malformed >&2; exit 1; fi
- echo "$ip" "$hostname" >> /etc/hosts
+ echo "$ip" "$hostname" >> "$ROOT"/etc/hosts
}
add_hosts() {
@@ -69,7 +71,7 @@ add_hosts() {
done
}
-echo >> /etc/hosts # insert line break
+echo >> "$ROOT"/etc/hosts # insert line break
append_host "$CONTROLLER_NODE_IP" "controller.$STACK_ID"