Script to delete zone from named.conf
bsd
bsd at todoo.biz
Thu Feb 4 20:02:50 UTC 2010
Thanks Evan,
I'll try that and maybe try to embed that on a bash script…
The formatting should be the same for most of my domains… Anyway I'll test that on copy of my zone file ;-)
sed and awk haven't got so friendly syntax; but they are indeed very powerful…
Sincerly yours.
Le 4 févr. 2010 à 19:19, Evan Hunt a écrit :
>> I know I can do that with grep, but you see I have 270 domains to delete
>> from my named.conf.
>>
>> My question was more: has anyone got a working script that I can use in
>> order to delete name from my "named.conf" file ?
>
> cat named.conf | \
> awk 'BEGIN {suppress = 0}
> /zone "whatever.com"/ {suppress = 1}
> {if (suppress == 0) print; if ($1 == "};" && NF == 1) suppress = 0}'
>
> Or words to that effect. Works as long as the zones are always formatted
> the same way.
>
> --
> Evan Hunt -- each at isc.org
> Internet Systems Consortium, Inc.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Gregober ---> PGP ID --> 0x1BA3C2FD
bsd @at@ todoo.biz
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
P "Please consider your environmental responsibility before printing this e-mail"
More information about the bind-users
mailing list