[techtalk] need help with a shell script

alissa bader mol666 at yahoo.com
Tue Sep 26 12:41:44 EST 2000


hey there.  I am trying to write a shell script to
update the named.conf file on our secondary
nameserver.

I want the formatting to read:
  
zone "domain.com" {
	type slave;
	file "d/db.domain";
	^^^^^^^^^^^^^^^^^^
	masters {
		204.177.32.2;
	};
};

with the "file" line reading like:
[first-letter-of-domain]/db.[domain-minus-top-level-domain]

The way I have it written so far is:

#!/bin/sh
for DOMAIN in `cat /tmp/ns1stuff`
do
	echo "zone" '"'"$DOMAIN"'"' "{" >> /etc/named.conf
	echo "	type slave;" >> /etc/named.conf
	echo  ' file "'$DOMAIN'";' >> /etc/named.conf
(etc etc etc)

which gives you an output of

zone "domain.com" {
	type slave;
	file "db.domain.com";
        ^^^^^^^^^^^^^^^^^^^^

argh.  and I cant for the life of me figure out how to
make it all nice and pretty as it should be.

any ideas?

thanks so much in advance!

--alissa

__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/




More information about the Techtalk mailing list