31 lines
623 B
Text
31 lines
623 B
Text
|
#!/usr/bin/awk -f
|
||
|
# AWK part for generating Windows/Samba boxes list in .nsmbrc format
|
||
|
# Incoming - findsmb output, outgoing - NetBIOS names list
|
||
|
# $Id: smb2awk,v 1.2 2003/10/30 09:41:10 shelton Exp $
|
||
|
|
||
|
{
|
||
|
while ((getline nline) > 0)
|
||
|
{
|
||
|
if (substr(nline,1,1) == "-")
|
||
|
{
|
||
|
sig = 1
|
||
|
continue
|
||
|
}
|
||
|
|
||
|
if (sig == 0)
|
||
|
continue
|
||
|
else
|
||
|
{
|
||
|
split(nline,narray," ")
|
||
|
|
||
|
if (narray[2] == "unknown")
|
||
|
next
|
||
|
else
|
||
|
if (index(narray[2],".") != 0)
|
||
|
next
|
||
|
else
|
||
|
print narray[2]
|
||
|
}
|
||
|
}
|
||
|
}
|