X-Git-Url: https://vcs.maemo.org/git/?p=samba;a=blobdiff_plain;f=packaging%2FDebian%2Fdebian-unstable%2Fwins2dns.awk;fp=packaging%2FDebian%2Fdebian-unstable%2Fwins2dns.awk;h=176868a115da37dcc987268f0b304521cbc6a1db;hp=0000000000000000000000000000000000000000;hb=6bca4ca307d55b6dc888e56cee47aebcddbce786;hpb=7fd70fa738b636089bcc6c961aa3eaa02f20dda2 diff --git a/packaging/Debian/debian-unstable/wins2dns.awk b/packaging/Debian/debian-unstable/wins2dns.awk new file mode 100644 index 0000000..176868a --- /dev/null +++ b/packaging/Debian/debian-unstable/wins2dns.awk @@ -0,0 +1,38 @@ +#!/usr/bin/awk -f +# +# Date: Wed, 26 Aug 1998 10:37:39 -0600 (MDT) +# From: Jason Gunthorpe +# To: samba@packages.debian.org +# Subject: Nifty samba script +# +# Here is a really nifty script I just wrote for samba, it takes the wins +# database in /var/samba/wins and writes out two dns files for it. In this +# way network wide wins clients can get into the dns for use by unix +# machines. +# +# Perhaps this could be included in /usr/doc/examples or somesuch. +# + +BEGIN { + FS="#|\""; +FORWARD="/tmp/wins.hosts" +REVERSE="/tmp/wins.rev" +DOMAIN="ven.ra.rockwell.com" +} +$3 == "00" { + split($4,a," " ); + split(a[2],b,"."); + while (sub(" ","-",$2)); + $2=tolower($2); + if (b[1] == "255") + next; + if (length($2) >= 8) + print $2"\ta\t"a[2] > FORWARD + else + print $2"\t\ta\t"a[2] > FORWARD + print b[4]"."b[3]"\t\tptr\t"$2"."DOMAIN"." > REVERSE +} +END { + system("echo killall -HUP named"); +} +