From 4ac748632458ba5b17b8a7b519f704eff2cd9316 Mon Sep 17 00:00:00 2001 From: dg9vh Date: Fri, 13 May 2016 16:02:21 +0000 Subject: [PATCH] Modes get red if corresponding process on host is not running, output of \'not linked\' if ircddbgateway is starting up or message if ircddbgateway is not running but D-Star is switched on in MMDVM.ini --- config/config.php | 3 +++ include/functions.php | 40 ++++++++++++++++++++++++++++++++++++---- 2 files changed, 39 insertions(+), 4 deletions(-) diff --git a/config/config.php b/config/config.php index 3610dda..9b5d550 100644 --- a/config/config.php +++ b/config/config.php @@ -71,6 +71,9 @@ switch (DISTRIBUTION) { define("CONFIGFILENAME", "ircddbgateway"); define("GATEWAYCONFIGPATH", CONFIGPATH . "/" . CONFIGFILENAME); +// set to called ircddbgateway-programm like ircddbgatewayd or ircddbgateway +define("IRCDDBGATEWAY", "ircddbgatewayd"); + // set time to refresh page define("REFRESHAFTER", "60"); diff --git a/include/functions.php b/include/functions.php index 49fec2b..6cd5b7f 100644 --- a/include/functions.php +++ b/include/functions.php @@ -6,8 +6,19 @@ function getMMDVMHostVersion() { if (file_exists($filename)) { return date("Y-m-d", filectime($filename)); } -} - +} + +function isProcessRunning($processname) { + exec("pgrep " . $processname, $pids); + if(empty($pids)) { + // process not running! + return false; + } else { + // process running! + return true; + } +} + function getMMDVMConfig() { // loads MMDVM.ini into array for further use $mmdvmconfigs = array(); @@ -49,7 +60,21 @@ function showMode($mode, $mmdvmconfigs) { ?>