summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx.manpages@gmail.com>2021-04-22 12:51:10 +0200
committerAlejandro Colomar <alx.manpages@gmail.com>2021-04-22 12:51:12 +0200
commitad1d205464c856bf607f63e860a1412e2118fa5c (patch)
tree5b3e7e1caa2d9ce4410b15362c2f0540d345c2bc
parentc5137b5dac5473a61513cdd4a074bb8419db2eef (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--Makefile9
-rw-r--r--etc/hosts13
2 files changed, 5 insertions, 17 deletions
diff --git a/Makefile b/Makefile
index 2893baf..d9d9d05 100644
--- a/Makefile
+++ b/Makefile
@@ -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
diff --git a/etc/hosts b/etc/hosts
index 2173023..237fe35 100644
--- a/etc/hosts
+++ b/etc/hosts
@@ -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