summaryrefslogtreecommitdiffstats
path: root/check.php
diff options
context:
space:
mode:
Diffstat (limited to 'check.php')
-rwxr-xr-xcheck.php98
1 files changed, 68 insertions, 30 deletions
diff --git a/check.php b/check.php
index 10571dbd..16138543 100755
--- a/check.php
+++ b/check.php
@@ -53,68 +53,84 @@ $archs = [
];
$mirrors = [
- 'http://remi.mirrors.arminco.com/',
'http://remi.conetix.com.au/',
'http://mirrors.neterra.net/remi/',
- 'http://remi.xpg.com.br/',
'http://remi.schlundtech.de/',
'http://mirror.cedia.org.ec/remi/',
- 'http://mirror.uta.edu.ec/remi/',
'http://ftp.arnes.si/mirrors/remi/',
'http://mirrors.thzhost.com/remi/',
- 'http://mirrors.mediatemple.net/remi/',
'http://fr2.rpmfind.net/linux/remi/',
- 'http://mirror.awanti.com/remi/',
'http://mirrors.netix.net/remi/',
'http://remi.mirrors.cu.be/',
- 'http://mirror.innosol.asia/remi/',
'http://mirror.neolabs.kz/remi/',
- 'http://mirror.veriteknik.net.tr/remi/',
'https://remi.mirror.ate.info/',
'https://mirrors.tuna.tsinghua.edu.cn/remi/',
- 'http://mirror.23media.de/remi/',
- 'http://repo1.dal.innoscale.net/remi/',
- 'http://repo1.sea.innoscale.net/remi/',
- 'http://repo1.ash.innoscale.net/remi/',
- 'http://mirror.bebout.net/remi/',
+ 'https://mirror.23m.com/remi/',
'https://mirror.oxilion.nl/remi/',
'https://remi.mirror.wearetriple.com/',
- 'http://mirror.upb.edu.co/remi/',
'https://mirrors.uni-ruse.bg/remi/',
'https://remi.mirror.karneval.cz/',
'https://mirror.netsite.dk/remi/',
- 'http://mirror.nsw.coloau.com.au/remi/',
'http://mirror.team-cymru.com/remi/',
- 'http://mirror.reconn.ru/remi/',
'http://mirrors.ukfast.co.uk/sites/remi/',
'https://mirror.netweaver.uk/remi/',
- 'http://mirror.xeonbd.com/remi/',
- 'http://mirrors.mivocloud.com/remi/',
'http://ftp.riken.jp/Linux/remi/',
'https://mir01.syntis.net/remirepo/',
'http://mirrors.bytes.ua/remi/',
- 'https://mirror.hoster.kz/remi/',
- 'http://ap.stykers.moe/remi/',
+ 'http://mirror.hoster.kz/remi/',
'http://remirepo.reloumirrors.net/',
'https://mirror.pit.teraswitch.com/remi/',
- 'https://mirror.sjc02.svwh.net/remi/',
- 'https://mirror.serverion.com/remi/',
'http://remi.mirror.liteserver.nl/',
'https://mirror.marwan.ma/remi/',
- 'https://remi.mivzakim.net/',
'https://remi.mirror.digitalpacific.com.au/',
- 'https://remi.srv.magticom.ge/',
'http://merlin.fit.vutbr.cz/mirrors/remi/',
- 'https://mirror.telkomuniversity.ac.id/remi/',
'https://mirrors.ptisp.pt/remi/',
'https://mirrors.chroot.ro/remi/',
'https://mirrors.upr.edu/remi/',
'http://mirror.digitalnova.at/remi/',
- 'http://mirror.yer.az/remi/',
'https://mirror.dk.team.blue/remi/',
'https://mirror.dogado.de/remi/',
+ 'https://mirror.docker.ru/remi/',
+ 'https://repo.extreme-ix.org/remi/',
+ 'https://mirror.mangohost.net/remi/',
+ 'https://bd.mirror.vanehost.com/Remi/',
+ 'https://repo1.vetta.net.nz/remi/',
+ 'https://cdn.fjordos.no/remi/',
+ 'https://mirror.fjordos.no/remi/',
+ 'https://muug.ca/mirror/remi/',
+ 'https://mirror.netzwerge.de/remi/',
+];
+$testing = [
+ 'https://pit1.mirror.jurassicinnovations.com/remi/',
+ 'https://mirror.raiolanetworks.com/remi/',
+ 'http://repo1.ash.innoscale.net/remi/',
+];
+$disabled = [
+ 'https://remi.mivzakim.net/', // 2024-04-03
+ 'https://mirror.usi.edu/pub/remi/', // 2024-04-03
+ 'http://mirror.awanti.com/remi/', // 2024-03-20
+ 'http://mirror.xeonbd.com/remi/',
+ 'https://mirror.telkomuniversity.ac.id/remi/',
+ 'http://mirror.uta.edu.ec/remi/',
+ 'http://repo1.dal.innoscale.net/remi/',
+ 'http://repo1.sea.innoscale.net/remi/',
+ 'http://mirror.yer.az/remi/',
];
$deprecated = [
+ 'https://remi.srv.magticom.ge/',
+ 'https://mirror.sjc02.svwh.net/remi/',
+ 'http://mirror.upb.edu.co/remi/',
+ 'http://mirror.veriteknik.net.tr/remi/',
+ 'http://remi.mirrors.arminco.com/',
+ 'http://mirror.reconn.ru/remi/',
+ 'https://mirror.serverion.com/remi/',
+ 'http://mirror.innosol.asia/remi/',
+ 'http://mirror.nsw.coloau.com.au/remi/',
+ 'http://mirror.bebout.net/remi/',
+ 'http://mirrors.mediatemple.net/remi/',
+ 'http://remi.xpg.com.br/',
+ 'http://ap.stykers.moe/remi/',
+ 'http://mirrors.mivocloud.com/remi/',
'http://nl.mirror.babylon.network/remi/',
'http://fr.mirror.babylon.network/remi/',
'http://ca.mirror.babylon.network/remi/',
@@ -183,10 +199,21 @@ if (!$cli) {
}
$pids = array();
$ref = getRepoTime($full);
+$mirrors = array_merge($mirrors, $testing);
if ($ref) {
- printf(($cli ? "Check %d mirrors of %s (%s)\n" : "<h3>%s - %s</h3>\n"), count($mirrors), $name, date('r', $ref));
if (!$cli) echo "<ul class='pkglist'>\n";
- foreach ($mirrors as $mirror) {
+ if (isset($_SERVER['argv'][1])) {
+ $tocheck = [];
+ foreach ($mirrors as $mirror) {
+ if (preg_match('|'.$_SERVER['argv'][1].'|', $mirror)) {
+ $tocheck[] = $mirror;
+ }
+ }
+ } else {
+ $tocheck = $mirrors;
+ }
+ printf(($cli ? "Check %d mirror(s) of %s (%s)\n" : "<h3>%s - %s</h3>\n"), count($tocheck), $name, date('r', $ref));
+ foreach ($tocheck as $mirror) {
if ($_SERVER['argc']>1 && !strpos($mirror, $_SERVER['argv'][1])) {
continue;
}
@@ -205,12 +232,14 @@ if ($ref) {
printf("%50.50s : ** Corrupted **\n", $mirror);
} else if ($ref == $loc) {
printf("%50.50s : Ok\n", $mirror);
+ exit(0);
} else if ($loc) {
printf("%50.50s : %s\n", $mirror, date('r', $loc));
+ exit(1);
} else {
printf("%50.50s : N/A\n", $mirror);
}
- break;
+ exit(2);
}
continue;
}
@@ -231,7 +260,8 @@ if ($ref) {
}
}
if ($cli) {
- $nb=count($pids);
+ $nb = count($pids);
+ $ok = $lack = 0;
while (count($pids)) {
if (posix_isatty(STDOUT)) {
printf("Wait %d\r", count($pids));
@@ -241,10 +271,18 @@ if ($ref) {
die("Cound not wait\n");
exit (1);
} else {
+ switch (pcntl_wexitstatus($status)) {
+ case 0:
+ $ok++;
+ break;
+ case 1:
+ $lack++;
+ break;
+ }
unset($pids[$pid]);
}
}
- if ($nb) printf("%d mirrors checked.\n", $nb);
+ if ($nb) printf("%3d mirrors checked,\n%3d are OK\n%3d are stalled\n%3d are KO.\n", $nb, $ok, $lack, $nb-$ok-$lack);
} else {
echo "</ul>\n";
}