Thread wer hat lust auf ein Spiel? (61 answers)
Opened by conray at 2010-02-19 20:31

betterworld
 2010-02-19 20:44
#133344 #133344
User since
2003-08-21
2613 Artikel
ModeratorIn

user image
Ich weiss nicht, ob das das ist, was Du Dir vorstellst, aber auf jeden Fall habe ich erstmal die "our" durch "my" ersetzt, denn das stach mir etwas ins Auge.
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/perl
use strict;
#EierlegendeWollMilchSau.pl
use Net::Ping;


if ($ARGV[0] eq '-p' ){

  my $input = $ARGV[1];

  my @namesplit = split(/\./, $input);

  my $r1 = $namesplit[0];
  my $r2 = $namesplit[1];
  my $r3 = $namesplit[2];
  my $r4 = $namesplit[3];


  my $till;
  if (!defined $ARGV[2]){
      $till = $r4;}
      else { $till = $ARGV[2]; }

  my $until = $till +1;

  while ($r4 != $until ) {
    my $ip = $r1.'.'.$r2.'.'.$r3.'.'.$r4;
    my $ping = Net::Ping->new( "icmp", 1, 64 );
  
    if ( $ping->ping($ip) ) {
      print "$ip online\n";
  } else {
      print "$ip offline \n";

  }  
     $r4++;
  }
}
elsif{ YOUR PART }
else{ exit 0;}


(ungetestet)

View full thread wer hat lust auf ein Spiel?