mumble-ping/mumble.php

28 lines
453 B
PHP
Executable File

<?php
header("Content-Type: application/json");
include "mumble-ping.php";
if(!isset($_GET["ip"])){
echo json_encode(["status" => "You need to provide an IP address you fat fuck"]);
die();
}
try{
$mumble = new mumble("GeoLite2-Country.mmdb");
echo json_encode(
$mumble->ping(
$_GET["ip"],
isset($_GET["port"]) ? $_GET["port"] : 64738,
)
);
}catch(Exception $error){
echo json_encode(["status" => $error->getMessage()]);
}
?>