sub pinghost {
my $host = shift;
- $p = Net::Ping->new();
+ $p = Net::Ping->new("icmp");
if ($p->ping($host)) {
logger("PING INFO: $host is alive");
return 1;
$allok = 1;
return 0;
} else {
- logger("DOWNLOAD ERROR: Could not open $Conf::cachedir/$bfile for writing.");
+ logger("DOWNLOAD ERROR: Could not open $Conf::tmpdir/$bfile for writing.");
}
} else {
return 0;
}
}
logger("MIRROR INFO: $scount servers found in list");
-
+
+ if ($scount eq 0) {
+ logger("MIRROR INFO: Could not find any servers. Falling back to main server $Conf::mainserver");
+ return ("HTTP", $Conf::mainserver, "/$Conf::version");
+ }
+
### Choose a random server and test if it is online
# If the check fails try a new server.
# This will never give up.
unless ( "$ret" eq "0" ) {
message("CRYPTO WARN: The GnuPG isn't configured corectly. Trying now to fix this.");
message("CRYPTO WARN: It's normal to see this on first execution.");
- my $command = "gpg --keyserver pgp.mit.edu --always-trust --status-fd 2";
+ my $command = "gpg --keyserver pgp.ipfire.org --always-trust --status-fd 2";
system("$command --recv-key $myid >> $Conf::logdir/gnupg-database.log 2>&1");
system("$command --recv-key $trustid >> $Conf::logdir/gnupg-database.log 2>&1");
} else {