But we hope that the script can be executed automatically when the Raspberry Pi board boots, we can use crontab command to achieve it. please refer to the following
===6. How to start PWM fan when pi 4 boots===
sudo crontab -e
Choose "1" then press Enter
Add a line at the end of the file that reads like this: