diff --git a/include/functions.php b/include/functions.php index bb5065f..ee5d4d6 100644 --- a/include/functions.php +++ b/include/functions.php @@ -488,26 +488,32 @@ function getActualLink($logLines, $mode) { // M: 2016-09-25 16:08:05.811 Connect to 62829 has been requested by DG9VH // M: 2016-10-01 17:52:36.586 Automatic connection to 62829 - foreach($logLines as $logLine) { - $to = ""; - if (strpos($logLine,"Starting YSFGateway")) { - $to = -1; - } - if (strpos($logLine,"DISCONNECT Reply")) { - $to = -1; - } - if (strpos($logLine,"Connect to")) { - $to = substr($logLine, 38, 5); - } - if (strpos($logLine,"Automatic connection to")) { - $to = substr($logLine, 51, 5); - } - if ($to !== "") { - return $to; + if (isProcessRunning(IRCDDBGATEWAY)) { + foreach($logLines as $logLine) { + $to = ""; + if (strpos($logLine,"Starting YSFGateway")) { + $to = -1; + } + if (strpos($logLine,"DISCONNECT Reply")) { + $to = -1; + } + if (strpos($logLine,"Connect to")) { + $to = substr($logLine, 38, 5); + } + if (strpos($logLine,"Automatic connection to")) { + $to = substr($logLine, 51, 5); + } + if ($to !== "") { + return $to; + } } + return -1; + break; + } else { + return -2; + break; } - return -1; - break; + } return "something went wrong!"; } @@ -559,6 +565,8 @@ function getActiveYSFReflectors() { function getYSFReflectorById($id, $reflectors) { if ($id ==-1) { return "not linked"; + } else if ($id == -2 ) { + return "YSFGateway not running"; } else { foreach($reflectors as $reflector) { if ($reflector[2] === $id) { diff --git a/version.php b/version.php index 3e4d0ba..b1ae34f 100644 --- a/version.php +++ b/version.php @@ -1,3 +1,3 @@