From 4da02bf322bc1b259076664b528b7419772c0f43 Mon Sep 17 00:00:00 2001 From: Richard Ipsum Date: Wed, 4 Mar 2015 11:35:04 +0000 Subject: openstack.configure: Use $ROOT --- openstack.configure | 6 ++++-- 1 file 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" -- cgit v1.2.1