Show more detailed output if not on master

This commit is contained in:
DL6ER
2016-12-09 23:18:47 +01:00
parent 4aab4e69cc
commit e93f33bcf0
+8 -6
View File
@@ -6,26 +6,28 @@
<div class="pull-right hidden-xs">
<?php
// Check if on a dev branch
$piholeVersion = exec("cd /etc/.pihole/ && git rev-parse --abbrev-ref HEAD");
$webVersion = exec("git rev-parse --abbrev-ref HEAD");
$piholeBranch = exec("cd /etc/.pihole/ && git rev-parse --abbrev-ref HEAD");
$webBranch = exec("git rev-parse --abbrev-ref HEAD");
// Use vDev if not on master
if($piholeVersion !== "master") {
if($piholeBranch !== "master") {
$piholeVersion = "vDev";
$piholeCommit = exec("cd /etc/.pihole/ && git describe --long --dirty --abbrev=10 --tags");
}
else {
$piholeVersion = exec("cd /etc/.pihole/ && git describe --tags --abbrev=0");
}
if($webVersion !== "master") {
if($webBranch !== "master") {
$webVersion = "vDev";
$webCommit = exec("git describe --long --dirty --abbrev=10 --tags");
}
else {
$webVersion = exec("git describe --tags --abbrev=0");
}
?>
<b>Pi-hole Version </b> <span id="piholeVersion"><?php echo $piholeVersion; ?></span>
<b>Web Interface Version </b> <span id="webVersion"><?php echo $webVersion; ?></span>
<b>Pi-hole Version </b> <span id="piholeVersion"><?php echo $piholeVersion; ?></span><?php if(isset($piholeCommit)) { echo " (".$piholeBranch.", ".$piholeCommit.")"; } ?>
<b>Web Interface Version </b> <span id="webVersion"><?php echo $webVersion; ?></span><?php if(isset($webCommit)) { echo " (".$webBranch.", ".$webCommit.")"; } ?>
</div>
<i class="fa fa-github"></i> <strong><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=3J2L3Z4DHW9UY">Donate</a></strong> if you found this useful.
</footer>