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

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"