mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-06 17:15:38 -08:00
This commit is contained in:
@@ -28,10 +28,7 @@ if(array_key_exists('settings', $_REQUEST) != FALSE)
|
||||
|
||||
// call functions based on requested params
|
||||
switch ($FUNCTION) {
|
||||
case 'restartBackend':
|
||||
|
||||
restartBackend();
|
||||
break;
|
||||
|
||||
case 'savesettings':
|
||||
|
||||
saveSettings();
|
||||
@@ -228,6 +225,7 @@ function displayMessage($message, $logAlert = FALSE, $logConsole = TRUE, $logFil
|
||||
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
// Adds an action to perform into the execution_queue.log file
|
||||
function addToExecutionQueue($action)
|
||||
{
|
||||
@@ -247,27 +245,6 @@ function addToExecutionQueue($action)
|
||||
}
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
function restartBackend()
|
||||
{
|
||||
$command = 'pkill -f "python /app/server" && (python /app/server > /dev/null 2>&1 &) && echo "done" 2>&1';
|
||||
|
||||
// Execute the command
|
||||
$output = [];
|
||||
$output_str = "";
|
||||
$return_var = 0;
|
||||
exec($command, $output, $return_var);
|
||||
|
||||
// Format the output
|
||||
foreach ($output as $line) {
|
||||
$output_str .= $line . "\n";
|
||||
}
|
||||
|
||||
|
||||
echo "Command result: $return_var, $output_str";
|
||||
|
||||
}
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
function cleanLog($logFile)
|
||||
|
||||
Reference in New Issue
Block a user