From e3c0a81f223f6628e63b50515da89adf97444477 Mon Sep 17 00:00:00 2001 From: randyjc Date: Tue, 11 Jul 2023 09:19:43 +0000 Subject: [PATCH] fixed permission issue by running it as user www-data --- lychee-sync.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lychee-sync.sh b/lychee-sync.sh index 231ac5e..f71034d 100755 --- a/lychee-sync.sh +++ b/lychee-sync.sh @@ -17,7 +17,7 @@ log_error() { # Run the PHP command log_message "Running PHP command..." -php /app/code/artisan lychee:sync /app/code/public/uploads/import/ >> "$LOG_FILE" 2>&1 +sudo -E -u www-data php /app/code/artisan lychee:sync /app/code/public/uploads/import/ >> "$LOG_FILE" 2>&1 php_exit_code=$? # Check if the PHP command succeeded @@ -34,3 +34,6 @@ if [ $php_exit_code -eq 0 ]; then else log_error "Error executing PHP command. Exit code: $php_exit_code" fi + +# Exit the script +exit 0