From 3949eff99ecd232db4d380a57874a9ef5adc6186 Mon Sep 17 00:00:00 2001 From: ehpersonal38 <103586016+ehpersonal38@users.noreply.github.com> Date: Mon, 30 May 2022 13:31:53 -0400 Subject: [PATCH] Update views.php Thank you! Co-Authored-By: Patrick McGuire <60325264+mcguirepr89@users.noreply.github.com> --- homepage/views.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homepage/views.php b/homepage/views.php index 30468c2..7e8723c 100644 --- a/homepage/views.php +++ b/homepage/views.php @@ -4,7 +4,7 @@ $user = shell_exec("awk -F: '/1000/{print $1}' /etc/passwd"); $home = shell_exec("awk -F: '/1000/{print $6}' /etc/passwd"); $home = trim($home); if(!isset($_SESSION['behind'])) { - $_SESSION['behind'] = trim(shell_exec("sudo git -C ".$home."/BirdNET-Pi fetch > /dev/null 2>&1 && 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 fetch > /dev/null 2>&1 && sudo -u$user git -C ".$home."/BirdNET-Pi status | sed -n '2 p' | cut -d ' ' -f 7")); } if(intval($_SESSION['behind']) >= 99) {?>