add hook, fix demo script

This commit is contained in:
Cold-Egg
2020-01-15 15:34:04 -05:00
parent bcf12dbf18
commit 3a1aa4c6fb
5 changed files with 36 additions and 7 deletions
+12
View File
@@ -0,0 +1,12 @@
#!/bin/bash
BOTCRON='/etc/cron.d/certbot'
certbothook(){
grep 'lswsctrl restart' ${BOTCRON} >/dev/null
if [ ${?} = 1 ]; then
echo 'Add LSWS hook to certbot cronjob.'
sed -i 's/0.*renew/& --deploy-hook "\/usr\/local\/lsws\/bin\/lswsctrl restart"/g' ${BOTCRON}
fi
}
certbothook