check whether ManiaControl.sh exists before trying to restart
This commit is contained in:
parent
3151ed2bc6
commit
c1cc6449c5
@ -251,7 +251,12 @@ class ManiaControl implements CallbackListener, CommandListener, TimerListener {
|
|||||||
$this->log("Can't restart ManiaControl because the function 'exec' is disabled!");
|
$this->log("Can't restart ManiaControl because the function 'exec' is disabled!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$command = 'sh ' . escapeshellarg(ManiaControlDir . 'ManiaControl.sh') . ' > /dev/null &';
|
$fileName = ManiaControlDir . 'ManiaControl.sh';
|
||||||
|
if (!is_readable($fileName)) {
|
||||||
|
$this->log("Can't restart ManiaControl because the file 'ManiaControl.sh' doesn't exist or isn't readable!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$command = 'sh ' . escapeshellarg($fileName) . ' > /dev/null &';
|
||||||
exec($command);
|
exec($command);
|
||||||
} else {
|
} else {
|
||||||
// Windows
|
// Windows
|
||||||
|
Loading…
Reference in New Issue
Block a user