31 lines
635 B
PHP
31 lines
635 B
PHP
<?php
|
|
$host = 'localhost';
|
|
//$ports = array(8080, 8880, 2052, 8888);
|
|
$ports = array(8443);
|
|
|
|
foreach ($ports as $port)
|
|
{
|
|
$connection = @fsockopen($host, $port);
|
|
|
|
if (is_resource($connection))
|
|
{
|
|
echo '<h2>' . $host . ':' . $port . ' ' . '(' . getservbyport($port, 'tcp') . ') is open.</h2>' . "\n";
|
|
|
|
fclose($connection);
|
|
}
|
|
|
|
else
|
|
{
|
|
echo '<h2>' . $host . ':' . $port . ' is not responding.</h2>' . "\n";
|
|
$fail = yes;
|
|
}
|
|
|
|
}
|
|
|
|
if ( $fail == "yes" ) {
|
|
print 'please check server motd - issues found cpanel.bateworld.com';
|
|
} else {
|
|
echo 'OK ! No failures found!';
|
|
}
|
|
|