38465-vm/api/start_bot.php
2026-02-16 06:00:13 +00:00

14 lines
348 B
PHP

<?php
declare(strict_types=1);
header('Content-Type: application/json');
$cmd = "cd ../bot && bash start_bot.sh 2>&1";
exec($cmd, $output, $returnVar);
if ($returnVar === 0) {
echo json_encode(['success' => true, 'output' => implode("\n", $output)]);
} else {
echo json_encode(['success' => false, 'error' => implode("\n", $output)]);
}