Skip to content

A live bird collage card for your Home Assistant dashboard.

no need to check the length

ehpersonal382151ac2181f2
diff --git a/homepage/views.php b/homepage/views.php
index 32f53d69..d446f633 100644
--- a/homepage/views.php
+++ b/homepage/views.php
@@ -6,9 +6,7 @@ $home = shell_exec("awk -F: '/1000/{print $6}' /etc/passwd");
$home = trim($home);
if(!isset($_SESSION['behind'])) {
$fetch = shell_exec("sudo -u".$user." git -C ".$home."/BirdNET-Pi fetch 2>&1");
- if(strlen($fetch) > 0) {
- $_SESSION['behind'] = trim(shell_exec("sudo -u".$user." git -C ".$home."/BirdNET-Pi status | sed -n '2 p' | cut -d ' ' -f 7"));
- }
+ $_SESSION['behind'] = trim(shell_exec("sudo -u".$user." git -C ".$home."/BirdNET-Pi status | sed -n '2 p' | cut -d ' ' -f 7"));
if(isset($_SESSION['behind'])&&intval($_SESSION['behind']) >= 99) {?>
<style>
.updatenumber {
diff --git a/scripts/system_controls.php b/scripts/system_controls.php
index 512784fb..335444cd 100644
--- a/scripts/system_controls.php
+++ b/scripts/system_controls.php
@@ -5,9 +5,7 @@ $user = trim($user);
$home = shell_exec("awk -F: '/1000/{print $6}' /etc/passwd");
$home = trim($home);
$fetch = shell_exec("sudo -u".$user." git -C ".$home."/BirdNET-Pi fetch 2>&1");
-if(strlen($fetch) > 0) {
- $_SESSION['behind'] = trim(shell_exec("sudo -u".$user." git -C ".$home."/BirdNET-Pi status | sed -n '2 p' | cut -d ' ' -f 7"));
-}
+$_SESSION['behind'] = trim(shell_exec("sudo -u".$user." git -C ".$home."/BirdNET-Pi status | sed -n '2 p' | cut -d ' ' -f 7"));
?><html>
<meta name="viewport" content="width=device-width, initial-scale=1">
<br>