mirror of https://github.com/dnomd343/kms-server
dnomd343
2 years ago
1 changed files with 15 additions and 0 deletions
@ -0,0 +1,15 @@ |
|||||
|
<?php |
||||
|
|
||||
|
require_once 'Process.php'; |
||||
|
|
||||
|
function kmsCheck(string $host, int $port = 1688): bool { |
||||
|
# TODO: ipv6 host add bracket |
||||
|
$vlmcs = new Process(['vlmcs', $host . ':' . $port], $capture = true); |
||||
|
while($vlmcs->isAlive()); // wait vlmcs exit |
||||
|
preg_match_all('/Sending activation request \(KMS V6\)/', $vlmcs->getStdout(), $match); |
||||
|
return count($match[0]) != 0; |
||||
|
} |
||||
|
|
||||
|
$host = 'kms.343.re'; |
||||
|
echo "check $host -> "; |
||||
|
echo (kmsCheck($host) ? 'yes' : 'no') . PHP_EOL; |
Loading…
Reference in new issue