mirror of
https://github.com/10h30/ols-docker-env.git
synced 2026-05-12 15:21:24 +09:00
modified: bin/acme.sh
This commit is contained in:
+24
-10
@@ -76,11 +76,15 @@ domain_filter(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
email_filter(){
|
email_filter(){
|
||||||
|
local EMAIL_CLEAN="${1%\"}"
|
||||||
|
EMAIL_CLEAN="${EMAIL_CLEAN#\"}"
|
||||||
|
|
||||||
CKREG="^[a-z0-9!#\$%&'*+/=?^_\`{|}~-]+(\.[a-z0-9!#$%&'*+/=?^_\`{|}~-]+)*@([a-z0-9]([a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]([a-z0-9-]*[a-z0-9])?\$"
|
CKREG="^[a-z0-9!#\$%&'*+/=?^_\`{|}~-]+(\.[a-z0-9!#$%&'*+/=?^_\`{|}~-]+)*@([a-z0-9]([a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]([a-z0-9-]*[a-z0-9])?\$"
|
||||||
if [[ "${1}" =~ ${CKREG} ]] ; then
|
|
||||||
echo -e "[O] The E-mail \033[32m${1}\033[0m is valid."
|
if [[ "${EMAIL_CLEAN}" =~ ${CKREG} ]]; then
|
||||||
|
echo -e "[O] The E-mail \033[32m${EMAIL_CLEAN}\033[0m is valid."
|
||||||
else
|
else
|
||||||
echo -e "[X] The E-mail \e[31m${1}\e[39m is invalid"
|
echo -e "[X] The E-mail \e[31m${EMAIL_CLEAN}\e[39m is invalid"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@@ -122,14 +126,24 @@ domain_verify(){
|
|||||||
install_acme(){
|
install_acme(){
|
||||||
echo '[Start] Install ACME'
|
echo '[Start] Install ACME'
|
||||||
if [ "${1}" = 'true' ]; then
|
if [ "${1}" = 'true' ]; then
|
||||||
docker compose exec litespeed su -c "cd; wget ${ACME_SRC}; chmod 755 acme.sh; \
|
docker compose exec litespeed su -c "
|
||||||
./acme.sh --install --cert-home ~/.acme.sh/certs; \
|
cd &&
|
||||||
rm ~/acme.sh"
|
wget ${ACME_SRC} &&
|
||||||
|
chmod 755 acme.sh &&
|
||||||
|
./acme.sh --install --cert-home ~/.acme.sh/certs &&
|
||||||
|
/root/.acme.sh/acme.sh --set-default-ca --server letsencrypt &&
|
||||||
|
rm ~/acme.sh
|
||||||
|
"
|
||||||
elif [ "${2}" != '' ]; then
|
elif [ "${2}" != '' ]; then
|
||||||
email_filter "${2}"
|
email_filter \"${2}\"
|
||||||
docker compose exec litespeed su -c "cd; wget ${ACME_SRC}; chmod 755 acme.sh; \
|
docker compose exec litespeed su -c "
|
||||||
./acme.sh --install --cert-home ~/.acme.sh/certs --accountemail ${2}; \
|
cd &&
|
||||||
rm ~/acme.sh"
|
wget ${ACME_SRC} &&
|
||||||
|
chmod 755 acme.sh &&
|
||||||
|
./acme.sh --install --cert-home ~/.acme.sh/certs --accountemail ${2} &&
|
||||||
|
/root/.acme.sh/acme.sh --set-default-ca --server letsencrypt &&
|
||||||
|
rm ~/acme.sh
|
||||||
|
"
|
||||||
else
|
else
|
||||||
help_message 1
|
help_message 1
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user