From 76fc74d96ed196a1a353feb602b4842c6c9160a0 Mon Sep 17 00:00:00 2001 From: mcguirepr89 Date: Mon, 30 May 2022 10:08:06 -0400 Subject: [PATCH] needs to be run as user to see the results --- scripts/system_controls.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/system_controls.php b/scripts/system_controls.php index ae0c0e2..7ba3aef 100644 --- a/scripts/system_controls.php +++ b/scripts/system_controls.php @@ -3,7 +3,7 @@ session_start(); $user = shell_exec("awk -F: '/1000/{print $1}' /etc/passwd"); $home = shell_exec("awk -F: '/1000/{print $6}' /etc/passwd"); $home = trim($home); -$_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")); ?>