Pretty output for statuscheck.php via GET #775

This commit is contained in:
Ulrich Block 2016-03-20 16:22:14 +01:00
parent cf27ae7e9d
commit 4fb084b67d

View File

@ -45,12 +45,11 @@ if (isset($_SERVER['REMOTE_ADDR'])) {
$timelimit = 600;
}
$args = array();
$checkTypesOfServer = array('gs', 'vs', 'vh', 'my', 'st');
if (isset($argv)) {
$args = array();
foreach ($argv as $a) {
if (in_array($a, $checkTypesOfServer)) {
$checkTypeOfServer = $a;
@ -113,6 +112,10 @@ $query->execute();
if (!isset($ip) or $ui->escaped('SERVER_ADDR', 'server') == $ip or in_array($ip, ipstoarray($rSA['cronjob_ips']))) {
if (isset($ip)) {
echo '<pre>';
}
if (isset($checkTypeOfServer)) {
if ($checkTypeOfServer == 'gs') {
print 'Checking Gameserver' . "\r\n";
@ -699,6 +702,10 @@ if (!isset($ip) or $ui->escaped('SERVER_ADDR', 'server') == $ip or in_array($ip,
$ssh2cmd = $folders . 'function r () { if [ "`ps fx | grep ' . $tsdnsbin . ' | grep -v grep`" == "" ]; then ./' . $tsdnsbin . ' > /dev/null & else ./' . $tsdnsbin . ' --update > /dev/null & fi }; r& ';
if ((isset($args['tsDebug']) and $args['tsDebug'] == 1)) {
print "$ssh2cmd\r\n";
}
if (ssh2_execute('vd', $row['id'], $ssh2cmd)) {
print "Restarting TSDNS: {$row['ssh2ip']}\r\n";
} else {