Browse Source

Append /etc/resolv.conf.tail if it exists

master
reyk 3 years ago
parent
commit
beef9f736c
  1. 5
      CHANGELOG.md
  2. 8
      agent/main.c

5
CHANGELOG.md

@ -1,5 +1,10 @@
# Changelog
## v1.0 (2019-11-29)
* Append `/etc/resolv.conf.tail` to `/etc/resolv.conf` if it exists.
* Fixed usage.
## v0.9 (2019-06-26)
* Added support for `-c` to specify the probing order of different cloud stacks.

8
agent/main.c

@ -838,7 +838,7 @@ agent_network(struct system_config *sc)
const char *family;
char domain[(NI_MAXHOST + 1) * 6 + 8]; /* up to 6 domains */
int has_domain = 0;
char ifidx[UINT16_MAX];
char ifidx[UINT16_MAX], *str;
const char *comment = "# Generated by cloud-agent";
if (!sc->sc_network)
@ -907,6 +907,12 @@ agent_network(struct system_config *sc)
if (has_domain)
fileout(domain, "a", "/etc/resolv.conf");
/* append resolv.conf.tail if it exists */
if ((str = filein("r", "/etc/resolv.conf.tail")) != NULL) {
fileout(str, "a", "/etc/resolv.conf");
free(str);
}
return (0);
}

Loading…
Cancel
Save