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