18 lines
481 B
PHP
18 lines
481 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
$action = $_GET['action'] ?? $_POST['action'] ?? '';
|
|
|
|
if (!in_array($action, ['wake_lan', 'wake_lan_status'], true)) {
|
|
http_response_code(404);
|
|
header('Content-Type: application/json; charset=utf-8');
|
|
header('Cache-Control: no-store');
|
|
echo json_encode([
|
|
'ok' => false,
|
|
'error' => 'unknown_action',
|
|
], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
|
|
exit;
|
|
}
|
|
|
|
require __DIR__ . '/../control/public/api.php';
|