Skip to content

A live bird collage card for your Home Assistant dashboard.

Modified way for getting current commit hash - more robust because now it works for branches

Louis Croisez6f674d1c2fe7
diff --git a/scripts/system_controls.php b/scripts/system_controls.php
index 5f1cc360..86ba61e9 100644
--- a/scripts/system_controls.php
+++ b/scripts/system_controls.php
@@ -45,7 +45,7 @@ function update() {
<button type="submit" name="submit" value="sudo clear_all_data.sh" onclick="return confirm('Clear ALL Data? Note that this cannot be undone and will take up to 90 seconds.')">Clear ALL data</button>
</form>
<?php
- $cmd="cat ".$home."/BirdNET-Pi/.git/refs/heads/main";
+ $cmd="cd ".$home."/BirdNET-Pi && sudo -u birdnet git rev-list --max-count=1 HEAD";
$curr_hash = shell_exec($cmd);
?>
<p style="font-size:11px;text-align:center"></br></br>Running version: </p>