TS Check
Check ob ein Teamspeack Server Online oder Offline ist
|
Script: |
<?php
if($_REQUEST['Send'])
{
function check_ts($ip, $tcp, $udp, $timeout=1) {
$fp = @fsockopen($ip, $tcp, $errno, $errstr, $timeout);
if (!$fp) {
$stat = false;
} else {
if (fgets($fp) == "[TS]\r\n") {
fputs($fp, "SEL $udp\r\n");
if (fgets($fp) == "OK\r\n") {
$stat = true;
} else {
$stat = false;
}
} else {
$stat = false;
}
if (is_resource($fp))
@fclose($fp);
return $stat;
}
}
$ts_ip = $_REQUEST['ip'];
$telnet = $_REQUEST['tcp'];
$ts_port = $_REQUEST['udp'];
if (check_ts("$ts_ip", $telnet, $ts_port)) {
echo "<div align=\"left\"><strong><FONT COLOR=#00cc00><B>online</B></FONT></strong></div>";
} else {
echo "<div align=\"left\"><strong><FONT COLOR=#FF0000><B>down</B></FONT></strong></div>";
}
}
else
{
echo " ";
}
?>
|
|