appstore-1panel/apps/openlitespeed/1.8.2-lsphp81/data/bin/container/certhookctl.sh
renovate[bot] 7f925c514e
chore(deps): update litespeedtech/openlitespeed docker tag to v1.8.2 (#2193)
* chore(deps): update litespeedtech/openlitespeed docker tag to v1.8.2

* Update app version [skip ci]

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: github-action update-app-version <githubaction@githubaction.com>
2024-09-27 13:56:15 +08:00

18 lines
483 B
Bash

#!/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