Samba 3: added Samba 3.0.24 sources
[tomato.git] / release / src / router / samba3 / packaging / Debian / debian-unstable / wins2dns.awk
blob176868a115da37dcc987268f0b304521cbc6a1db
1 #!/usr/bin/awk -f
3 # Date: Wed, 26 Aug 1998 10:37:39 -0600 (MDT)
4 # From: Jason Gunthorpe <jgg@deltatee.com>
5 # To: samba@packages.debian.org
6 # Subject: Nifty samba script
8 # Here is a really nifty script I just wrote for samba, it takes the wins
9 # database in /var/samba/wins and writes out two dns files for it. In this
10 # way network wide wins clients can get into the dns for use by unix
11 # machines.
13 # Perhaps this could be included in /usr/doc/examples or somesuch.
16 BEGIN {
17 FS="#|\"";
18 FORWARD="/tmp/wins.hosts"
19 REVERSE="/tmp/wins.rev"
20 DOMAIN="ven.ra.rockwell.com"
22 $3 == "00" {
23 split($4,a," " );
24 split(a[2],b,".");
25 while (sub(" ","-",$2));
26 $2=tolower($2);
27 if (b[1] == "255")
28 next;
29 if (length($2) >= 8)
30 print $2"\ta\t"a[2] > FORWARD
31 else
32 print $2"\t\ta\t"a[2] > FORWARD
33 print b[4]"."b[3]"\t\tptr\t"$2"."DOMAIN"." > REVERSE
35 END {
36 system("echo killall -HUP named");