22 lines
503 B
PHP
Executable File
22 lines
503 B
PHP
Executable File
#!/usr/local/psa/admin/bin/php
|
|
<?php
|
|
require_once('sdk.php');
|
|
pm_Context::init('notifier');
|
|
|
|
if ($argc < 4) {
|
|
$cmd = reset($argv);
|
|
echo "Usage: {$cmd} <host> <ports> <timeout>\n";
|
|
echo "e.g. {$cmd} smtp.gmail.com 25,587 3\n";
|
|
exit(1);
|
|
}
|
|
|
|
$host = $argv[1];
|
|
$ports = explode(',', $argv[2]);
|
|
$timeout = (int)$argv[3];
|
|
|
|
$checker = new PleskExt\Notifier\MailPorts\Checker($host, $ports, $timeout);
|
|
$list = $checker->run()->detectUnavailablePorts();
|
|
|
|
echo implode(',', $list) . "\n";
|
|
exit(0);
|