author | llornkcor <llornkcor> | 2005-08-14 21:38:11 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2005-08-14 21:38:11 (UTC) |
commit | ab6f37a50ef2a0d95f25eff4a749bfcf39057d65 (patch) (side-by-side diff) | |
tree | 91e13ab3324e231cd3d04432b07ac8b6574f4511 /bin | |
parent | b2b07591469338fb360edd8f7fc8e5aa888c4021 (diff) | |
download | opie-ab6f37a50ef2a0d95f25eff4a749bfcf39057d65.zip opie-ab6f37a50ef2a0d95f25eff4a749bfcf39057d65.tar.gz opie-ab6f37a50ef2a0d95f25eff4a749bfcf39057d65.tar.bz2 |
opie-smb needs this
-rwxr-xr-x | bin/smbfind | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/bin/smbfind b/bin/smbfind new file mode 100755 index 0000000..7bc9ee6 --- a/dev/null +++ b/bin/smbfind @@ -0,0 +1,22 @@ +#!/bin/sh +# +# export PATH=$PATH:/dos/extras/bin +# +# A replacement for standard perl findsmb. +# +# First get list of ip addresses +# +IPS=`nmblookup \* |awk '{print $1}'|grep -v "Send"` +echo +echo "IP Address Name Description" +echo "*************************************" +echo +for i in $IPS +do + # For each ip address that responds lookup name + value=`echo $i|awk '{print $1}'` + MACHINE=`nmblookup -T -A $value |grep "<00>"|awk '{h=tolower($1); print h}'|head -n1` + TYPE=`smbclient -N -L $MACHINE -I $value 2>&1 |grep "Domain="|head -n1|sed 's/ /_/g'` + + echo "$value $MACHINE $TYPE" +done |