You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
483 B

#!/bin/bash
BOTCRON='/var/spool/cron/crontabs/root'
cert_hook(){
grep 'acme' ${BOTCRON} >/dev/null
if [ ${?} = 0 ]; then
grep 'lswsctrl' ${BOTCRON} >/dev/null
if [ ${?} = 0 ]; then
echo 'Hook already exist, skip!'
else
sed -i 's/--cron/--cron --renew-hook "\/usr\/local\/lsws\/bin\/lswsctrl restart"/g' ${BOTCRON}
fi
else
echo "[X] ${BOTCRON} does not exist, please check it later!"
fi
}
cert_hook