From bd7fee901246ee35d869a1f77813457b25a0bb9f Mon Sep 17 00:00:00 2001 From: ehpersonal38 <103586016+ehpersonal38@users.noreply.github.com> Date: Fri, 20 May 2022 09:51:26 -0400 Subject: [PATCH] Update stats.php --- scripts/stats.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/stats.php b/scripts/stats.php index 3987187..329aa7d 100644 --- a/scripts/stats.php +++ b/scripts/stats.php @@ -56,8 +56,9 @@ if(isset($_GET['species'])){ $user = shell_exec("awk -F: '/1000/{print $1}' /etc/passwd"); $home = shell_exec("awk -F: '/1000/{print $6}' /etc/passwd"); $home = trim($home); -if(!file_exists($home."/BirdNET-Pi/scripts/disk_check_exclude.txt")) { - file_put_contents($home."/BirdNET-Pi/scripts/disk_check_exclude.txt", "##start\n##end"); +if(!file_exists($home."/BirdNET-Pi/scripts/disk_check_exclude.txt") || strpos(file_get_contents($home."/BirdNET-Pi/scripts/disk_check_exclude.txt"),"##start") === false) { + file_put_contents($home."/BirdNET-Pi/scripts/disk_check_exclude.txt", ""); + file_put_contents($home."/BirdNET-Pi/scripts/disk_check_exclude.txt", "##start\n##end\n"); } ?>