From 031785343fcf91f53857678970db1f3ba4437ce0 Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Thu, 4 Nov 2021 22:49:39 -0700 Subject: meta-google: gbmc-ncsi-config: Remove override if empty Currently this will make no difference in configuration, but it will be useful once we implement our DHCP process and need to contend with multiple configurations. Change-Id: Ia93530e67cdb88fcbe90ef2b6dfbd5a239469ff7 Signed-off-by: William A. Kennington III --- .../recipes-google/ncsi/files/gbmc-ncsi-br-pub-addr.sh.in | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'meta-google') diff --git a/meta-google/recipes-google/ncsi/files/gbmc-ncsi-br-pub-addr.sh.in b/meta-google/recipes-google/ncsi/files/gbmc-ncsi-br-pub-addr.sh.in index b04f2aa8f..78af419c5 100644 --- a/meta-google/recipes-google/ncsi/files/gbmc-ncsi-br-pub-addr.sh.in +++ b/meta-google/recipes-google/ncsi/files/gbmc-ncsi-br-pub-addr.sh.in @@ -36,14 +36,14 @@ gbmc_ncsi_br_pub_addr_update() { done fi - local contents='[Network]'$'\n' + local contents= if (( ${#pfx_bytes[@]} != 0 )); then pfx_bytes[8]=0xfd local stateless_pfx="$(ip_bytes_to_str pfx_bytes)" pfx_bytes[9]=0x01 local ncsi_pfx="$(ip_bytes_to_str pfx_bytes)" - local here= - read -r -d '' here <"$file" + if [ -z "$contents" ]; then + rm -f "$file" + else + printf '%s' "$contents" >"$file" + fi done # Ensure that systemd-networkd performs a reconfiguration as it doesn't -- cgit v1.2.3