|
|
|
@ -27,9 +27,19 @@ class Checker implements Task
@@ -27,9 +27,19 @@ class Checker implements Task
|
|
|
|
|
public function run(Environment $environment) |
|
|
|
|
{ |
|
|
|
|
$bob = new BOB($this->options); |
|
|
|
|
|
|
|
|
|
$bob->getnick(); |
|
|
|
|
$result = $bob->lookup($this->base32 . ".b32.i2p"); |
|
|
|
|
|
|
|
|
|
$result = false; |
|
|
|
|
for ($i = 0, $tries = $this->options['check_tries']; $i < $tries; ++$i) { |
|
|
|
|
$result = $bob->lookuplocal($this->base32 . ".b32.i2p"); |
|
|
|
|
if(!$result) { |
|
|
|
|
$result = $bob->lookup($this->base32 . ".b32.i2p"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ($result) { |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$bob = null; |
|
|
|
|
echo "Processed " . $this->base32 . ": " . ($result ? "online" : "offline") . PHP_EOL; |
|
|
|
|