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)
tags/10.4.2
Alex Schultz 1 month ago
parent
commit
84659474d5
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() {
16 16
         temp=$(mktemp)
17 17
         (
18 18
         sed '/^# HEAT_HOSTS_START/,$d' "$file"
19
-        echo -ne "\n# HEAT_HOSTS_START - Do not edit manually within this section!\n"
19
+        echo -ne "# HEAT_HOSTS_START - Do not edit manually within this section!\n"
20 20
         echo "$entries"
21
-        echo -ne "# HEAT_HOSTS_END\n\n"
21
+        echo -ne "# HEAT_HOSTS_END\n"
22 22
         sed '1,/^# HEAT_HOSTS_END/d' "$file"
23 23
         ) > "$temp"
24 24
         echo "INFO: Updating hosts file $file, check below for changes"

Loading…
Cancel
Save