version-info of DMRGateway added

This commit is contained in:
Kim Huebel 2017-07-12 22:44:51 +02:00
parent ab327a3f0c
commit 8fdb3a3052
4 changed files with 59 additions and 2 deletions

View file

@ -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 #<a href=\"https://github.com/g4klx/DMRGateway/commit/" . substr($output[0],32,7) . "\" target=\"_blank\">" . substr($output[0],32,7) . "</a>)";
} 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() { function getFirmwareVersion() {
$logPath = MMDVMLOGPATH."/".MMDVMLOGPREFIX."-".date("Y-m-d").".log"; $logPath = MMDVMLOGPATH."/".MMDVMLOGPREFIX."-".date("Y-m-d").".log";
$logLines = explode("\n", `egrep "MMDVM protocol version" $logPath`); $logLines = explode("\n", `egrep "MMDVM protocol version" $logPath`);

View file

@ -62,7 +62,11 @@ include "version.php";
echo " "._("Hotspot"); echo " "._("Hotspot");
} }
?>:</small> <?php echo getCallsign($mmdvmconfigs) ?></h1> ?>:</small> <?php echo getCallsign($mmdvmconfigs) ?></h1>
<h4>MMDVMHost by G4KLX Version: <?php echo getMMDVMHostVersion() ?><br>Firmware: <?php echo getFirmwareVersion() ?> <h4>MMDVMHost by G4KLX Version: <?php echo getMMDVMHostVersion() ?><br>Firmware: <?php echo getFirmwareVersion();
if (defined("ENABLEDMRGATEWAY")) {
?>
<br>DMRGateway by G4KLX Version: <?php echo getDMRGatewayVersion();
} ?>
<?php <?php
if (defined("JSONNETWORK")) { if (defined("JSONNETWORK")) {
$key = recursive_array_search(getDMRNetwork(),$networks); $key = recursive_array_search(getDMRNetwork(),$networks);

View file

@ -127,6 +127,33 @@ include "include/tools.php";
<input type="text" value="<?php echo constant("YSFHOSTSFILENAME") ?>" name="YSFHOSTSFILENAME" class="form-control" placeholder="YSFHosts.txt" aria-describedby="YSFHOSTSFILENAME"> <input type="text" value="<?php echo constant("YSFHOSTSFILENAME") ?>" name="YSFHOSTSFILENAME" class="form-control" placeholder="YSFHosts.txt" aria-describedby="YSFHOSTSFILENAME">
</div> </div>
</div> </div>
<div class="container">
<h2><?php echo _("DMRGateway-Configuration"); ?></h2>
<div class="input-group">
<span class="input-group-addon" id="ENABLEDMRGATEWAY" style="width: 300px"><?php echo _("Enable DMRGateway"); ?></span>
<div class="panel-body"><input type="checkbox" name="ENABLEDMRGATEWAY" <?php if (defined("ENABLEDMRGATEWAY")) echo "checked" ?>></div>
</div>
<div class="input-group">
<span class="input-group-addon" id="DMRGATEWAYLOGPATH" style="width: 300px"><?php echo _("Path to DMRGateway-logfile"); ?></span>
<input type="text" value="<?php echo constant("DMRGATEWAYLOGPATH") ?>" name="DMRGATEWAYLOGPATH" class="form-control" placeholder="/var/log/DMRGateway/" aria-describedby="DMRGATEWAYLOGPATH">
</div>
<div class="input-group">
<span class="input-group-addon" id="DMRGATEWAYLOGPREFIX" style="width: 300px"><?php echo _("Logfile-prefix"); ?></span>
<input type="text" value="<?php echo constant("DMRGATEWAYLOGPREFIX") ?>" name="DMRGATEWAYLOGPREFIX" class="form-control" placeholder="DMRGateway" aria-describedby="DMRGATEWAYLOGPREFIX">
</div>
<div class="input-group">
<span class="input-group-addon" id="DMRGATEWAYINIPATH" style="width: 300px"><?php echo _("Path to DMRGateway.ini"); ?></span>
<input type="text" value="<?php echo constant("YSFGATEWAYINIPATH") ?>" name="YSFGATEWAYINIPATH" class="form-control" placeholder="/etc/YSFGateway/" aria-describedby="YSFGATEWAYINIPATH">
</div>
<div class="input-group">
<span class="input-group-addon" id="DMRGATEWAYPATH" style="width: 300px"><?php echo _("Path to DMRGateway-executable"); ?></span>
<input type="text" value="<?php echo constant("DMRGATEWAYPATH") ?>" name="DMRGATEWAYPATH" class="form-control" placeholder="/usr/local/bin/" aria-describedby="DMRGATEWAYPATH">
</div>
<div class="input-group">
<span class="input-group-addon" id="YSFGATEWAYINIFILENAME" style="width: 300px"><?php echo _("YSFGateway.ini-filename"); ?></span>
<input type="text" value="<?php echo constant("DMRGATEWAYINIFILENAME") ?>" name="DMRGATEWAYINIFILENAME" class="form-control" placeholder="DMRGateway.ini" aria-describedby="DMRGATEWAYINIFILENAME">
</div>
</div>
<div class="container"> <div class="container">
<h2><?php echo _("ircddbgateway-Configuration"); ?></h2> <h2><?php echo _("ircddbgateway-Configuration"); ?></h2>
<div class="input-group"> <div class="input-group">

View file

@ -1,3 +1,3 @@
<?php <?php
define("VERSION", "20170712-1 (".getGitVersion().")"); define("VERSION", "20170712-2 (".getGitVersion().")");
?> ?>