diff options
author | Alejandro Colomar <alx.manpages@gmail.com> | 2021-04-22 12:51:10 +0200 |
---|---|---|
committer | Alejandro Colomar <alx.manpages@gmail.com> | 2021-04-22 12:51:12 +0200 |
commit | ad1d205464c856bf607f63e860a1412e2118fa5c (patch) | |
tree | 5b3e7e1caa2d9ce4410b15362c2f0540d345c2bc | |
parent | c5137b5dac5473a61513cdd4a074bb8419db2eef (diff) |
hosts: Don't overwrite the hole filev0.7.0
Instead, just add a block, with delimiters. This way, it can coexist with
other contents
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
-rw-r--r-- | Makefile | 9 | ||||
-rw-r--r-- | etc/hosts | 13 |
2 files changed, 5 insertions, 17 deletions
@@ -74,12 +74,9 @@ groff: .PHONY: hosts .SILENT: hosts hosts: - cd $(SYSCONFDIR) && \ - find hosts -type f \ - |while read -r f; do \ - echo " INSTALL $(DESTDIR)$(sysconfdir)/$$f"; \ - install -DT "$$f" "$(DESTDIR)$(sysconfdir)/$$f"; \ - done; + sed -i '/# alejandro-colomar.es\s*BEGIN/,/# alejandro-colomar.es\s*END/d' \ + $(DESTDIR)$(sysconfdir)/hosts; + cat $(SYSCONFDIR)/hosts >> $(DESTDIR)$(sysconfdir)/hosts; .PHONY: ssh .SILENT: ssh @@ -1,5 +1,4 @@ -127.0.0.1 localhost - +# alejandro-colomar.es BEGIN 10.168.10.50 builder0.alejandro-colomar.es builder0 10.168.10.51 builder1.alejandro-colomar.es builder1 10.168.10.52 builder2.alejandro-colomar.es builder2 @@ -11,12 +10,4 @@ 10.168.10.200 manager0.alejandro-colomar.es manager0 10.168.10.201 manager1.alejandro-colomar.es manager1 10.168.10.202 manager2.alejandro-colomar.es manager2 - -# The following lines are desirable for IPv6 capable hosts -::1 ip6-localhost ip6-loopback -fe00::0 ip6-localnet -ff00::0 ip6-mcastprefix -ff02::1 ip6-allnodes -ff02::2 ip6-allrouters -ff02::3 ip6-allhosts - +# alejandro-colomar.es END |