debug.php 819 B

12345678910111213141516171819202122232425
  1. <?php
  2. if(!DEFINED('EGP'))
  3. exit(header('Refresh: 0; URL=http://'.$_SERVER['SERVER_NAME'].'/404'));
  4. $html->nav('Отладочный лог');
  5. $sql->query('SELECT `address`, `passwd` FROM `control` WHERE `id`="'.$id.'" LIMIT 1');
  6. $unit = $sql->get();
  7. include(LIB.'ssh.php');
  8. if(!$ssh->auth($unit['passwd'], $unit['address']))
  9. sys::back($cfg['http'].'control/id/'.$id.'/server/'.$sid.'/section/settings');
  10. // Чтение файла - oldstart.log
  11. $file = '/servers/'.$server['uid'].'/debug.log';
  12. $ssh->set('echo "" >> '.$file.' && cat '.$file.' | grep "CRASH: " | grep -ve "^#\|^[[:space:]]*$"');
  13. $html->get('debug', 'sections/control/servers/games/settings');
  14. $html->set('log', htmlspecialchars($ssh->get(), NULL, ''));
  15. $html->pack('main');
  16. ?>