/[mon-modules]/fping+args.monitor
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 /fping+args.monitor

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

revision 1.2 by dpavlin, Wed Jul 10 09:26:32 2002 UTC revision 1.3 by dpavlin, Wed Jul 10 10:04:48 2002 UTC
# Line 1  Line 1 
1  #!/usr/bin/perl  #!/usr/bin/perl -w
2  #  #
3  # Return a list of hosts which not reachable via ICMP echo  # Return a list of hosts which not reachable via ICMP echo
4  #  #
# Line 62  my @hosts; Line 62  my @hosts;
62  # this part will strip everything after hostname  # this part will strip everything after hostname
63  foreach (@ARGV) {  foreach (@ARGV) {
64          if (m/^[^:]+:?[^\@]*\@([^\/]+)\/?.*/) {          if (m/^[^:]+:?[^\@]*\@([^\/]+)\/?.*/) {
65                  push @hosts,$1;                  my $host = $1;
66                    push @hosts,$host if (! grep /^$host$/,@hosts);
67          } else {          } else {
68                  push @hosts,$_;                  push @hosts,$_ if (! grep /^$_$/,@hosts);
69          }          }
70  }  }
71    

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.26