TSDNS and TS3 not restarted due to new binary names #776

This commit is contained in:
Ulrich Block 2016-03-20 16:46:58 +01:00
parent 4fb084b67d
commit ba65a0f77f
2 changed files with 9 additions and 6 deletions

View File

@ -687,7 +687,7 @@ if (!isset($ip) or $ui->escaped('SERVER_ADDR', 'server') == $ip or in_array($ip,
$folders = (substr($row['serverdir'], 0, 1) == '/') ? 'cd /' : 'cd ';
while ($i <= $folderfilecount) {
$folders = $folders.$split_config[$i] . '/';
$folders = $folders . $split_config[$i] . '/';
$lastFolder = $split_config[$i];
$i++;
}
@ -700,7 +700,7 @@ if (!isset($ip) or $ui->escaped('SERVER_ADDR', 'server') == $ip or in_array($ip,
$folders = $folders . ' && ';
}
$ssh2cmd = $folders . 'function r () { if [ "`ps fx | grep ' . $tsdnsbin . ' | grep -v grep`" == "" ]; then ./' . $tsdnsbin . ' > /dev/null & else ./' . $tsdnsbin . ' --update > /dev/null & fi }; r& ';
$ssh2cmd = $folders . ' if [ -f "tsdnsserver" ]; then TSDNSBIN="tsdnsserver"; else TSDNSBIN="' . $tsdnsbin . '"; fi; 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";
@ -867,11 +867,11 @@ if (!isset($ip) or $ui->escaped('SERVER_ADDR', 'server') == $ip or in_array($ip,
}
if ($tsdown == true) {
$cmds[] = $folders . 'function r () { if [ "`ps fx | grep ' . $tsbin . ' | grep -v grep`" == "" ]; then ./ts3server_startscript.sh start > /dev/null & else ./ts3server_startscript.sh restart > /dev/null & fi }; r& ';
$cmds[] = $folders . 'if [ -f "ts3server" ]; then TSBIN="ts3server"; else TSBIN="' . $tsdnsbin . '"; fi; function r () { if [ "`ps fx | grep $TSBIN | grep -v grep`" == "" ]; then ./ts3server_startscript.sh start > /dev/null & else ./ts3server_startscript.sh restart > /dev/null & fi }; r& ';
}
if ($vrow['usedns'] == 'Y' and $tsdnsdown == true) {
$cmds[] = $tsdnsFolders . 'function r () { if [ "`ps fx | grep ' . $tsdnsbin . ' | grep -v grep`" == "" ]; then ./' . $tsdnsbin . ' > /dev/null & else ./' . $tsdnsbin . ' --update > /dev/null & fi }; r& ';
$cmds[] = $tsdnsFolders . 'if [ -f "tsdnsserver" ]; then TSDNSBIN="tsdnsserver"; else TSDNSBIN="' . $tsdnsbin . '"; fi; function r () { if [ "`ps fx | grep ' . $tsdnsbin . ' | grep -v grep`" == "" ]; then ./' . $tsdnsbin . ' > /dev/null & else ./' . $tsdnsbin . ' --update > /dev/null & fi }; r& ';
}
if (count($cmds) > 0) {
@ -882,7 +882,7 @@ if (!isset($ip) or $ui->escaped('SERVER_ADDR', 'server') == $ip or in_array($ip,
print "Failed restarting: $restartreturn $queryip\r\n";
}
if (isset($dbConnect['debug']) and $dbConnect['debug'] == 1) {
if ((isset($dbConnect['debug']) and $dbConnect['debug'] == 1) or (isset($args['tsDebug']) and $args['tsDebug'] == 1)) {
print_r($cmds);
}
}

View File

@ -140,8 +140,11 @@ if (!function_exists('ssh2_execute')) {
}
$query->execute(array($notified, $serverID));
return ($notified == 0) ? $return : false;
if (strlen($return) == 0) {
$return = true;
}
return ($notified == 0) ? $return : false;
}
}