-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathkillMatrix.php
executable file
·64 lines (36 loc) · 1.1 KB
/
killMatrix.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/php
<?
//error_reporting(0);
$pluginName ="MatrixMessage";
$myPid = getmypid();
$DEBUG=false;
$skipJSsettings = 1;
include_once("/opt/fpp/www/config.php");
include_once("/opt/fpp/www/common.php");
include_once("functions.inc.php");
require ("lock.helper.php");
define('LOCK_DIR', '/tmp/');
define('LOCK_SUFFIX', '.lock');
$logFile = $settings['logDirectory']."/".$pluginName.".log";
$fpp_matrixtools_Plugin = "fpp-matrixtools";
$fpp_matrixtools_Plugin_Script = "scripts/matrixtools";
$P10Matrix = urldecode(ReadSettingFromFile("P10Matrix",$pluginName));
logEntry("unlocking matrix.php");
//unlock the pid
//lockHelper::unlock();
//clearMatrix();
if(file_exists("/tmp/matrix.php.lock")) {
$matrix_pid = file_get_contents("/tmp/matrix.php.lock");
$cmdKill = "sudo kill -9 ".$matrix_pid;
exec($cmdKill);
}
//$cmdKillPHPMatrix = "sudo killall -9 matrix.php";
//logEntry("Killing php matrix: ".$cmdKillPHPMatrix);
//exec($cmdKillPHPMatrix);
//sleep(1);
$cmdKill = "sudo killall -9 matrixtools";
logEntry("Killing Matrix pid:");
exec($cmdKill,$result);
clearMatrix();
//print_r($result);
?>