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)
This commit is contained in:
Alex Schultz 2019-08-06 15:47:11 -06:00
parent 2c8a6a577f
commit 84659474d5
1 changed files with 2 additions and 2 deletions

View File

@ -16,9 +16,9 @@ write_entries() {
temp=$(mktemp) temp=$(mktemp)
( (
sed '/^# HEAT_HOSTS_START/,$d' "$file" 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 "$entries"
echo -ne "# HEAT_HOSTS_END\n\n" echo -ne "# HEAT_HOSTS_END\n"
sed '1,/^# HEAT_HOSTS_END/d' "$file" sed '1,/^# HEAT_HOSTS_END/d' "$file"
) > "$temp" ) > "$temp"
echo "INFO: Updating hosts file $file, check below for changes" echo "INFO: Updating hosts file $file, check below for changes"