summaryrefslogtreecommitdiff
path: root/openstack.configure
diff options
context:
space:
mode:
Diffstat (limited to 'openstack.configure')
-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"