.lock // // RESPONSE // {"ok":true} lock removed, or already absent // {"ok":false,"error":string} wrong method or a filename that failed validation // // DEPENDS ON // nothing — /tmp/unraid_locks is written by the shell layer's locking helper // ═══════════════════════════════════════════════════════════════════════════════════════════════ header('Content-Type: application/json'); if ($_SERVER['REQUEST_METHOD'] !== 'POST') { echo json_encode(['ok' => false, 'error' => 'POST only']); exit; } $file = basename($_POST['file'] ?? ''); if (!$file || !preg_match('/^[a-zA-Z0-9_\-]+\.lock$/', $file)) { echo json_encode(['ok' => false, 'error' => 'Invalid filename']); exit; } $path = '/tmp/unraid_locks/' . $file; if (file_exists($path)) @unlink($path); echo json_encode(['ok' => true]);