All pastes #814546 Raw Edit

Stuff

public text v1 · immutable
·published 2007-12-13 11:57 UTC
rendered paste body
#!/usr/bin/perl
use strict;
use warnings;
use DBI;
use Net::Ping;
my $i = {
    'cfg'   => "servers.cfg"
};
 
## SLAVE:IP:VPNIP:GLPORT:SSHPORT
open (CFG, "<", "$i->{cfg}");
print "Opening file ".$i->{cfg}."\n";
while (my $slave = <CFG>) {
    my ($name, $wanip, $vpnip, $glport, $sshport) = split(/:/, $slave);
    print
        "Name: ".$name.
        "\nWanip: ".$wanip.
        "\nVpnip: ".$vpnip.
        "\nGlport: ". $glport.
        "\nsshport: ". $sshport. "\n";
    my $pingstatus = getping($wanip, $vpnip);
}
 
sub getping {
  my $wanip = $_[0];
  my $vpnip = $_[1];
  print "Trying to ping wan: $wanip\n";
  print "Trying to ping vpn: $vpnip\n";
}