mirror of
https://github.com/10h30/ols-docker-env.git
synced 2026-05-12 15:21:24 +09:00
add ssl renwal
This commit is contained in:
+38
@@ -8,6 +8,9 @@ TYPE=0
|
|||||||
CONT_NAME='litespeed'
|
CONT_NAME='litespeed'
|
||||||
ACME_SRC='https://raw.githubusercontent.com/Neilpang/acme.sh/master/acme.sh'
|
ACME_SRC='https://raw.githubusercontent.com/Neilpang/acme.sh/master/acme.sh'
|
||||||
EPACE=' '
|
EPACE=' '
|
||||||
|
RENEW=''
|
||||||
|
RENEW_ALL=''
|
||||||
|
FORCE=''
|
||||||
|
|
||||||
echow(){
|
echow(){
|
||||||
FLAG=${1}
|
FLAG=${1}
|
||||||
@@ -172,6 +175,30 @@ install_cert(){
|
|||||||
echo '[End] Apply Lets Encrypt Certificate'
|
echo '[End] Apply Lets Encrypt Certificate'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
renew_acme(){
|
||||||
|
echo '[Start] Renew ACME'
|
||||||
|
if [ "${FORCE}" = 'true' ]; then
|
||||||
|
docker-compose exec ${CONT_NAME} su -c "~/.acme.sh/acme.sh --renew --domain ${1} --force"
|
||||||
|
else
|
||||||
|
docker-compose exec ${CONT_NAME} su -c "~/.acme.sh/acme.sh --renew --domain ${1}"
|
||||||
|
fi
|
||||||
|
echo '[End] Renew ACME'
|
||||||
|
lsws_restart
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
renew_all_acme(){
|
||||||
|
echo '[Start] Renew all ACME'
|
||||||
|
if [ "${FORCE}" = 'true' ]; then
|
||||||
|
docker-compose exec ${CONT_NAME} su -c "~/.acme.sh/acme.sh --renew-all --force"
|
||||||
|
else
|
||||||
|
docker-compose exec ${CONT_NAME} su -c "~/.acme.sh/acme.sh --renew-all"
|
||||||
|
fi
|
||||||
|
echo '[End] Renew all ACME'
|
||||||
|
lsws_restart
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
main(){
|
main(){
|
||||||
check_acme
|
check_acme
|
||||||
domain_filter ${DOMAIN}
|
domain_filter ${DOMAIN}
|
||||||
@@ -199,6 +226,17 @@ while [ ! -z "${1}" ]; do
|
|||||||
UNINSTALL=true
|
UNINSTALL=true
|
||||||
uninstall_acme
|
uninstall_acme
|
||||||
;;
|
;;
|
||||||
|
-[fF] | --force )
|
||||||
|
FORCE=true
|
||||||
|
;;
|
||||||
|
-[r] | --renew )
|
||||||
|
RENEW_=true
|
||||||
|
renew_acme ${DOMAIN}
|
||||||
|
;;
|
||||||
|
-[R] | --renew-all )
|
||||||
|
RENEW_ALL=true
|
||||||
|
renew_all_acme
|
||||||
|
;;
|
||||||
-[eE] | --email ) shift
|
-[eE] | --email ) shift
|
||||||
check_input "${1}"
|
check_input "${1}"
|
||||||
EMAIL="${1}"
|
EMAIL="${1}"
|
||||||
|
|||||||
Reference in New Issue
Block a user