diff --git a/include/functions.php b/include/functions.php index 23b9db4..f44cc9c 100644 --- a/include/functions.php +++ b/include/functions.php @@ -26,6 +26,32 @@ function getMMDVMHostFileVersion() { } } +function getDMRGatewayVersion() { + // returns creation-time or version of DMRGateway as version-number + $filename = DMRGATEWAYPATH."/DMRGateway"; + exec($filename." -v 2>&1", $output); + if (!startsWith(substr($output[0],19,8),"20")) { + showLapTime("getDMRGatewayVersion"); + return getDMRGatewayFileVersion(); + } else { + showLapTime("getDMRGatewayVersion"); + if (strlen($output[0]) > 26) { + return substr($output[0],19,8)." ("._("compiled")." ".getDMRGatewayFileVersion(). ", GitID #" . substr($output[0],32,7) . ")"; + } else { + return substr($output[0],19,8)." ("._("compiled")." ".getDMRGatewayFileVersion(). ")"; + } + } +} + +function getDMRGatewayFileVersion() { + // returns creation-time of DMRGateway as version-number + $filename = DMRGATEWAYPATH."/DMRGateway"; + if (file_exists($filename)) { + showLapTime("getDMRGatewayFileVersion"); + return date("d M Y", filectime($filename)); + } +} + function getFirmwareVersion() { $logPath = MMDVMLOGPATH."/".MMDVMLOGPREFIX."-".date("Y-m-d").".log"; $logLines = explode("\n", `egrep "MMDVM protocol version" $logPath`); diff --git a/index.php b/index.php index ea697c8..c343531 100644 --- a/index.php +++ b/index.php @@ -62,7 +62,11 @@ include "version.php"; echo " "._("Hotspot"); } ?>: -

MMDVMHost by G4KLX Version:
Firmware: +

MMDVMHost by G4KLX Version:
Firmware: +
DMRGateway by G4KLX Version: " name="YSFHOSTSFILENAME" class="form-control" placeholder="YSFHosts.txt" aria-describedby="YSFHOSTSFILENAME"> +
+

+
+ +
>
+
+
+ + " name="DMRGATEWAYLOGPATH" class="form-control" placeholder="/var/log/DMRGateway/" aria-describedby="DMRGATEWAYLOGPATH"> +
+
+ + " name="DMRGATEWAYLOGPREFIX" class="form-control" placeholder="DMRGateway" aria-describedby="DMRGATEWAYLOGPREFIX"> +
+
+ + " name="YSFGATEWAYINIPATH" class="form-control" placeholder="/etc/YSFGateway/" aria-describedby="YSFGATEWAYINIPATH"> +
+
+ + " name="DMRGATEWAYPATH" class="form-control" placeholder="/usr/local/bin/" aria-describedby="DMRGATEWAYPATH"> +
+
+ + " name="DMRGATEWAYINIFILENAME" class="form-control" placeholder="DMRGateway.ini" aria-describedby="DMRGATEWAYINIFILENAME"> +
+

diff --git a/version.php b/version.php index fe451b7..9e98384 100644 --- a/version.php +++ b/version.php @@ -1,3 +1,3 @@