From 45cb429de2e414d5af6275a9fa0854cb47d9d0d7 Mon Sep 17 00:00:00 2001
From: "Leigh B. Stoller" <stoller@flux.utah.edu>
Date: Wed, 27 Oct 2004 16:55:21 +0000
Subject: [PATCH] A bit more hackery for elabinelab. I think this named stuff
 is going to have to be done in perl; trying to do it with simple substitution
 is not really viable.

---
 named/GNUmakefile.in  | 4 +++-
 named/forward.head.in | 2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/named/GNUmakefile.in b/named/GNUmakefile.in
index 97441285a0..345373efcf 100644
--- a/named/GNUmakefile.in
+++ b/named/GNUmakefile.in
@@ -16,6 +16,8 @@ OURDOMAIN       = @OURDOMAIN@
 # This is silly. Needs to be done properly.
 TESTBED_NETWORK = @TESTBED_NETWORK@
 REVERSE_MAPNAME = $(subst .0,,$(TESTBED_NETWORK))
+BOSSTOKEN       = $(shell echo @BOSSNODE@ | sed -e 's/\..*//')
+USERTOKEN       = $(shell echo @USERNODE@ | sed -e 's/\..*//')
 
 NAMED_FILES	= named.conf.template named_makeconf \
 		  reverse.head resolv.conf localhost.rev forward.head \
@@ -37,7 +39,7 @@ $(REVERSE_MAPNAME).db.head:	reverse.head
 	cat reverse.head | sed -e 's/$(REVERSE_MAPNAME)\.//' > $(REVERSE_MAPNAME).db.head
 
 $(OURDOMAIN).db.head:		forward.head
-	cp forward.head $(OURDOMAIN).db.head
+	cat forward.head | sed -e 's/BOSSTOKEN/$(BOSSTOKEN)/' -e 's/USERTOKEN/$(USERTOKEN)/' > $(OURDOMAIN).db.head
 
 named.conf:	named.conf.template named_makeconf
 	perl named_makeconf named.conf.template > named.conf
diff --git a/named/forward.head.in b/named/forward.head.in
index c84ed9eef7..e62c6343c2 100644
--- a/named/forward.head.in
+++ b/named/forward.head.in
@@ -23,6 +23,7 @@ $TTL	30
 ; and boss are both A records
 ns		IN	A		@BOSSNODE_IP@
 boss		IN	A		@BOSSNODE_IP@
+BOSSTOKEN	IN	A		@BOSSNODE_IP@
 		IN	MX 10	ops
 
 ; CNAMEs for boss
@@ -32,6 +33,7 @@ cvsup		IN	CNAME	boss
 
 ; Plastic and names it is otherwise known as...
 ops		IN	A		@USERNODE_IP@
+USERTOKEN	IN	A		@USERNODE_IP@
 		IN	MX 10	ops
 users		IN	CNAME	ops
 fs		IN	CNAME	ops
-- 
GitLab