Merge pull request #997 from Robbt/fix-status-page

Simplified status page check to work under Debian
This commit is contained in:
Kyle Robbertze 2020-04-18 10:54:26 +02:00 committed by GitHub
commit 6df9e51981
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -113,8 +113,8 @@ function checkRMQConnection() {
* @return boolean true if airtime-analyzer is running
*/
function checkAnalyzerService() {
exec("pgrep -f -u www-data airtime_analyzer", $out, $status);
if (array_key_exists(0, $out) && $status == 0) {
exec("pgrep -f airtime_analyzer", $out, $status);
if (($out > 0) && $status == 0) {
return posix_kill(rtrim($out[0]), 0);
}
return $status == 0;
@ -126,8 +126,8 @@ function checkAnalyzerService() {
* @return boolean true if airtime-playout is running
*/
function checkPlayoutService() {
exec("pgrep -f -u www-data airtime-playout", $out, $status);
if (array_key_exists(0, $out) && $status == 0) {
exec("pgrep -f airtime-playout", $out, $status);
if ($out > 0) {
return posix_kill(rtrim($out[0]), 0);
}
return $status == 0;
@ -139,8 +139,8 @@ function checkPlayoutService() {
* @return boolean true if airtime-liquidsoap is running
*/
function checkLiquidsoapService() {
exec("pgrep -f -u www-data airtime-liquidsoap", $out, $status);
if (array_key_exists(0, $out) && $status == 0) {
exec("pgrep -f airtime-liquidsoap", $out, $status);
if ($out > 0) {
return posix_kill(rtrim($out[0]), 0);
}
return $status == 0;