fixing linked YSFReflector when not running YSFGateway

This commit is contained in:
dg9vh 2016-10-13 19:58:20 +00:00
parent 39b8852f15
commit 0aa06e46ec
2 changed files with 27 additions and 19 deletions

View file

@ -488,6 +488,7 @@ function getActualLink($logLines, $mode) {
// M: 2016-09-25 16:08:05.811 Connect to 62829 has been requested by DG9VH // 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 // M: 2016-10-01 17:52:36.586 Automatic connection to 62829
if (isProcessRunning(IRCDDBGATEWAY)) {
foreach($logLines as $logLine) { foreach($logLines as $logLine) {
$to = ""; $to = "";
if (strpos($logLine,"Starting YSFGateway")) { if (strpos($logLine,"Starting YSFGateway")) {
@ -508,6 +509,11 @@ function getActualLink($logLines, $mode) {
} }
return -1; return -1;
break; break;
} else {
return -2;
break;
}
} }
return "something went wrong!"; return "something went wrong!";
} }
@ -559,6 +565,8 @@ function getActiveYSFReflectors() {
function getYSFReflectorById($id, $reflectors) { function getYSFReflectorById($id, $reflectors) {
if ($id ==-1) { if ($id ==-1) {
return "not linked"; return "not linked";
} else if ($id == -2 ) {
return "YSFGateway not running";
} else { } else {
foreach($reflectors as $reflector) { foreach($reflectors as $reflector) {
if ($reflector[2] === $id) { if ($reflector[2] === $id) {

View file

@ -1,3 +1,3 @@
<?php <?php
define("VERSION", "20161013-3"); define("VERSION", "20161013-4");
?> ?>