This commit is contained in:
Cold-Egg
2020-01-09 16:42:48 -05:00
parent 6b9bd702d7
commit a8beeaa87e
6 changed files with 89 additions and 13 deletions
+47 -2
View File
@@ -1,3 +1,48 @@
#!/usr/bin/env bash
docker-compose exec litespeed su -c "certbot certonly --agree-tos --register-unsafely-without-email --webroot -w /var/www/vhosts/${1}/html -d ${1} -d www.${1}"
echo OLS needs to be restarted to detect the certificates
DOMAIN=''
help_message(){
echo 'Command [your_domain]'
echo 'Script will get database password and wordpress password from .env file and install the demo wordpress site for you'
}
check_input(){
if [ -z "${1}" ]; then
help_message
exit 1
fi
}
strip_www(){
CHECK_WWW=$(echo ${1} | cut -c1-4)
if [[ ${CHECK_WWW} == www. ]] ; then
DOMAIN=$(echo ${1} | cut -c 5-)
else
DOMAIN=${1}
fi
}
lecertapply(){
docker-compose exec litespeed su -c "certbot certonly --agree-tos --register-unsafely-without-email \
--non-interactive --webroot -w /var/www/vhosts/${1}/html -d ${1} -d www.${1}"
}
main(){
strip_www ${1}
lecertapply ${DOMAIN}
}
check_input ${1}
while [ ! -z "${1}" ]; do
case ${1} in
-[hH] | -help | --help)
help_message
;;
*)
main ${1}
;;
esac
shift
done