summaryrefslogtreecommitdiff
path: root/source3/script/findsmb.in
diff options
context:
space:
mode:
Diffstat (limited to 'source3/script/findsmb.in')
-rwxr-xr-xsource3/script/findsmb.in21
1 files changed, 7 insertions, 14 deletions
diff --git a/source3/script/findsmb.in b/source3/script/findsmb.in
index 5ca1d8082a..d2aa94591b 100755
--- a/source3/script/findsmb.in
+++ b/source3/script/findsmb.in
@@ -5,7 +5,7 @@
# run as root to get correct info from WIN95 clients.
#
# syntax:
-# findsmb [-d|-D] [-r] [subnet broadcast address]
+# findsmb [subnet broadcast address]
#
# with no agrument it will list machines on the current subnet
#
@@ -13,26 +13,19 @@
# local master browsers for that workgroup. There will be an "*" in front
# of the workgroup name for machines that are the domain master browser for
# that workgroup.
-#
-# Options:
-#
-# -d|-D enable debug
-# -r add -r option to nmblookup when finding netbios name
#
$SAMBABIN = "@prefix@/bin";
-for ($i = 0; $i < 2; $i++) { # test for -d and -r options
+for ($i = 0; $i < 2; $i++) { # test for -d option and broadcast address
$_ = shift;
if (m/-d|-D/) {
$DEBUG = 1;
- } else (m/-r/) {
- $R_OPTION = "-r";
- }
-}
-
-if ($_) { # set broadcast address if it was specified
+ } else {
+ if ($_) {
$BCAST = "-B $_";
+ }
+ }
}
sub ipsort # do numeric sort on last field of IP address
@@ -63,7 +56,7 @@ foreach $ip (@ipaddrs) # loop through each IP address found
# find the netbios names registered by each machine
- open(NMBLOOKUP,"$SAMBABIN/nmblookup $R_OPTION -A $ip|") ||
+ open(NMBLOOKUP,"$SAMBABIN/nmblookup -r -A $ip|") ||
die("Can't get nmb name list.\n");
@nmblookup = <NMBLOOKUP>;
close NMBLOOKUP;