chore: initial commit

This commit is contained in:
2026-06-13 00:11:05 +01:00
commit 2742a3baac
10 changed files with 277 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
<?php
$host = "10.1.1.2";
echo json_encode(ping($host));
function ping($host) {
$command = "ping -c 4 " . escapeshellarg($host);
$output = [];
exec($command, $output, $status);
// Check if the ping was successful
if ($status == 0) {
return ['status' => 'online', 'output' => $output];
} else {
return ['status' => 'offline', 'output' => $output];
}
}
?>