]> ###2025.01.21 - fixed cron error messages leading in email call ###2024.12.31 - added a loop lookup for correct temp, compare and take lower value ###2024.12.21a - added extra HDD Section for split setup (following main temp fan rules) - added aggressiv mode for CPU mode (more demanding flexible CPU cooling) ###2024.12.18 - fixed log fetching (less spam) ###2024.12.14 - cosmetics - added log page ###2024.12.07 - beta run ###2024.12.03 - Initial Release. **PWM Fan** Plugin to control pwm fan/s by CPU or HDD Temps &gitURL;/packages/&name;.txz echo "Checking executable flags..." if [ -f /usr/local/emhttp/plugins/pwm-fan/scripts/none ]; then if [ ! -x /usr/local/emhttp/plugins/pwm-fan/scripts/none ]; then chmod +x /usr/local/emhttp/plugins/pwm-fan/scripts/* echo "scripts are executable." else echo "scripts where already executable." fi else echo "script doesn't exist." fi echo "Starting Actions and pwm if crons where set ..." /usr/local/emhttp/plugins/pwm-fan/scripts/fans.sh touch /boot/config/plugins/pwm-fan/pwmfansettings sed -i 's/^cron_state=.*//' /boot/config/plugins/pwm-fan/pwmfansettings sed -i 's/^hdd_cron_state=.*//' /boot/config/plugins/pwm-fan/pwmfansettings sed -i 's/^hdd_extra_cron_state=.*//' /boot/config/plugins/pwm-fan/pwmfansettings sed -i '/^$/d' /boot/config/plugins/pwm-fan/pwmfansettings echo 'cron_state=""' >> /boot/config/plugins/pwm-fan/pwmfansettings echo 'hdd_cron_state=""' >> /boot/config/plugins/pwm-fan/pwmfansettings echo 'hdd_extra_cron_state=""' >> /boot/config/plugins/pwm-fan/pwmfansettings /usr/local/emhttp/plugins/pwm-fan/scripts/cpu_cron.sh /usr/local/emhttp/plugins/pwm-fan/scripts/hdd_cron.sh /usr/local/emhttp/plugins/pwm-fan/scripts/hdd_extra_cron.sh if [ ! -z "$(crontab -l | grep -i pwm_hdd.sh)" ]; then echo "cronjob for HDD pwm started" sed -i 's/^hdd_cron_state=.*/hdd_cron_state="started"/' /boot/config/plugins/pwm-fan/pwmfansettings else echo "cron for HDD not started" sed -i 's/^hdd_cron_state=.*/hdd_cron_state="stopped"/' /boot/config/plugins/pwm-fan/pwmfansettings fi if [ ! -z "$(crontab -l | grep -i pwm_hdd_extra.sh)" ]; then echo "cronjob for HDD extra pwm started" sed -i 's/^hdd_extra_cron_state=.*/hdd_extra_cron_state="started"/' /boot/config/plugins/pwm-fan/pwmfansettings else echo "cron for HDD not started" sed -i 's/^hdd_extra_cron_state=.*/hdd_extra_cron_state="stopped"/' /boot/config/plugins/pwm-fan/pwmfansettings fi if [ ! -z "$(crontab -l | grep -i pwm-fan.sh)" ]; then echo "cronjob for CPU pwm started" sed -i 's/^cron_state=.*/cron_state="started"/' /boot/config/plugins/pwm-fan/pwmfansettings else echo "cron for CPU not started" sed -i 's/^cron_state=.*/cron_state="stopped"/' /boot/config/plugins/pwm-fan/pwmfansettings fi touch /usr/local/emhttp/plugins/pwm-fan/pwm_log.txt rm -f $(ls &plgPATH;/&name;*.txz 2>/dev/null|grep -v '&version;') echo "Removing &name;..." removepkg &plgPATH;/*.txz rm -rf &plgPATH; rm -rf &emhttp; crontab -l | grep -v "HDD " | crontab - crontab -l | grep -v "pwm_hdd.sh" | crontab - crontab -l | grep -v "HDDextra" | crontab - crontab -l | grep -v "pwm_hdd_extra.sh" | crontab - crontab -l | grep -v "CPU" | crontab - crontab -l | grep -v "pwm-fan.sh" | crontab - sed -i 's/^cron_state=.*//' /boot/config/plugins/pwm-fan/pwmfansettings sed -i 's/^hdd_cron_state=.*//' /boot/config/plugins/pwm-fan/pwmfansettings sed -i 's/^hdd_extra_cron_state=.*//' /boot/config/plugins/pwm-fan/pwmfansettings sed -i '/^$/d' /boot/config/plugins/pwm-fan/pwmfansettings echo "&name; has been removed"