Browse Source

Fix line comparisons

There was a leading \n and a trailing \n that is causing the script to
add two lines everytime it's run.

Change-Id: I42530b64efc8e7be0d309401c284f16050256e8a
(cherry picked from commit d51d61a247)
changes/17/675917/1 queens-em
Alex Schultz 2 years ago
parent
commit
7e0c59a905
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      elements/hosts/os-refresh-config/configure.d/51-hosts

+ 2
- 2
elements/hosts/os-refresh-config/configure.d/51-hosts View File

@ -16,9 +16,9 @@ write_entries() {
temp=$(mktemp)
(
sed '/^# HEAT_HOSTS_START/,$d' "$file"
echo -ne "\n# HEAT_HOSTS_START - Do not edit manually within this section!\n"
echo -ne "# HEAT_HOSTS_START - Do not edit manually within this section!\n"
echo "$entries"
echo -ne "# HEAT_HOSTS_END\n\n"
echo -ne "# HEAT_HOSTS_END\n"
sed '1,/^# HEAT_HOSTS_END/d' "$file"
) > "$temp"
echo "INFO: Updating hosts file $file, check below for changes"


Loading…
Cancel
Save