81 |
next if !/^\s*smbmount\s/; |
next if !/^\s*smbmount\s/; |
82 |
my (undef,$share,undef,$opt) = split(/\s+/,$_,4); |
my (undef,$share,undef,$opt) = split(/\s+/,$_,4); |
83 |
|
|
84 |
my ($user,$passwd,$workgroup); |
my ($user,$passwd,$workgroup,$ip); |
85 |
|
|
86 |
foreach (split(/,/,$opt)) { |
foreach (split(/,/,$opt)) { |
87 |
my ($n,$v) = split(/=/,$_,2); |
my ($n,$v) = split(/=/,$_,2); |
97 |
} |
} |
98 |
} elsif ($n =~ m#workgroup#i) { |
} elsif ($n =~ m#workgroup#i) { |
99 |
$workgroup = $v; |
$workgroup = $v; |
100 |
|
} elsif ($n =~ m#ip#i) { |
101 |
|
$ip = $v; |
102 |
} |
} |
103 |
} |
} |
104 |
|
|
123 |
|
|
124 |
print "working on $share\n"; |
print "working on $share\n"; |
125 |
|
|
126 |
|
# try to nmblookup IP |
127 |
my $ip = get_ip($share); |
$ip = get_ip($share) if (! $ip); |
128 |
|
|
129 |
if ($ip) { |
if ($ip) { |
130 |
xlog($share,"IP is $ip"); |
xlog($share,"IP is $ip"); |
505 |
foreach my $f (sort { $file_md5{$a} cmp $file_md5{$b} } keys %file_md5) { |
foreach my $f (sort { $file_md5{$a} cmp $file_md5{$b} } keys %file_md5) { |
506 |
my $dir = dirname($f); |
my $dir = dirname($f); |
507 |
my $file = basename($f); |
my $file = basename($f); |
508 |
print "$f -- $dir / $file<--\n"; |
#print "$f -- $dir / $file<--\n"; |
509 |
if ($dir ne $last_dir) { |
if ($dir ne $last_dir) { |
510 |
close($md5) if ($md5); |
close($md5) if ($md5); |
511 |
open($md5, ">> $bc/$dir/.md5sum") || warn "can't create $bc/$dir/.md5sum: $!"; |
open($md5, ">> $bc/$dir/.md5sum") || warn "can't create $bc/$dir/.md5sum: $!"; |
514 |
} |
} |
515 |
print $md5 $file_md5{$f}," $file\n"; |
print $md5 $file_md5{$f}," $file\n"; |
516 |
} |
} |
517 |
close($md5); |
close($md5) if ($md5); |
518 |
|
|
519 |
# create leatest link |
# create leatest link |
520 |
#print "ln -s $bc $real_bl\n"; |
#print "ln -s $bc $real_bl\n"; |