summaryrefslogtreecommitdiffstats
path: root/check.php
diff options
context:
space:
mode:
Diffstat (limited to 'check.php')
-rwxr-xr-xcheck.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/check.php b/check.php
index 946f93c4..a733c2d8 100755
--- a/check.php
+++ b/check.php
@@ -232,12 +232,13 @@ 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));
} else {
printf("%50.50s : N/A\n", $mirror);
}
- break;
+ exit(1);
}
continue;
}
@@ -259,6 +260,7 @@ if ($ref) {
}
if ($cli) {
$nb=count($pids);
+ $ok=0;
while (count($pids)) {
if (posix_isatty(STDOUT)) {
printf("Wait %d\r", count($pids));
@@ -268,10 +270,11 @@ if ($ref) {
die("Cound not wait\n");
exit (1);
} else {
+ if (!pcntl_wexitstatus($status)) $ok++;
unset($pids[$pid]);
}
}
- if ($nb) printf("%d mirrors checked.\n", $nb);
+ if ($nb) printf("%d mirrors checked, %d OK.\n", $nb, $ok);
} else {
echo "</ul>\n";
}