From f62a0c49513eb14889140c97a45464631ebf341f Mon Sep 17 00:00:00 2001 From: Daniel Sosnowski Date: Wed, 14 Jan 2026 16:00:55 +0100 Subject: [PATCH] Added an if statement and logging --- pdt.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pdt.sh b/pdt.sh index b41d795..f486b14 100644 --- a/pdt.sh +++ b/pdt.sh @@ -4,5 +4,12 @@ readarray -t files < /var/www/html/storage/focode/file_list_temp.txt for file in "${files[@]}" do - ls -l "$file" + output=$(php compress.php process "$file") + if [[ $output -gt 0 ]] + then + echo "ERROR! Exiting the program" + exit 1 + fi + + echo "Processed file: $file: $output" | tee -a "/var/log/pdt$(date +%d%m%Y).log" done \ No newline at end of file