/[psinib]/psinib.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /psinib.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9 by dpavlin, Tue Jul 15 17:40:32 2003 UTC revision 1.11 by dpavlin, Sun Oct 12 15:58:28 2003 UTC
# Line 81  while(<M>) { Line 81  while(<M>) {
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);
# Line 97  while(<M>) { Line 97  while(<M>) {
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    
# Line 121  while(<M>) { Line 123  while(<M>) {
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");
# Line 503  sub snap_share { Line 505  sub snap_share {
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: $!";
# Line 512  print "$f -- $dir / $file<--\n"; Line 514  print "$f -- $dir / $file<--\n";
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";

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.11

  ViewVC Help
Powered by ViewVC 1.1.26