litespeedtech / ls-cloud-image

GNU General Public License v3.0
36 stars 38 forks source link

Centos 9 crontab logic skipped #47

Closed shor0814 closed 5 months ago

shor0814 commented 8 months ago

When generating the crontab for the certbot check, the logic skips Centos 9. I assume that the entry for one of the other versions will work correctly.

Maybe:

elif [ "${OSNAME}" = 'centos' ]; then if [ "${OSVER}" = '7' ]; then echo "0 0,12 root python -c 'import random; import time; time.sleep(random.random() 3600)' && certbot renew -q --deploy-hook 'systemctl restart lsws'" \ | sudo tee -a /etc/crontab > /dev/null elif [ "${OSVER}" = '8' ]; then echo "0 0,12 root python3 -c 'import random; import time; time.sleep(random.random() 3600)' && /usr/local/bin/certbot renew -q --deploy-hook 'systemctl restart lsws'" \ | sudo tee -a /etc/crontab > /dev/null elif [ "${OSVER}" = '9' ]; then echo "0 0,12 root python3 -c 'import random; import time; time.sleep(random.random() 3600)' && /usr/local/bin/certbot renew -q --deploy-hook 'systemctl restart lsws'" \ | sudo tee -a /etc/crontab > /dev/null else echoY 'Please check certbot crontab'

Love the utilities.

Code-Egg commented 5 months ago

Thanks. I just updated the vhost script in the latest commit