script genrate let's encrypt cert
#!/bin/bash
# specify the location of Let's Encrypt tool
# with its parameters
certbot='/usr/bin/certbot --agree-tos --email [email protected] --apache --redirect --expand -n '
vhost=( `cat "domain-list.txt" `)
# loop variables
ssl_exec="${certbot}"
n=1
#################### START ##########################
for t in "${vhost[@]}"
do
ssl_exec="${ssl_exec} -d $t "
let "n++"
# every 100th domain, create a SSL certificate
if (( n == 100 )); then
$ssl_exec
#echo $ssl_exec
# reset the loop variables
ssl_exec="${certbot}"
n=1
fi
done
# create SSl certificate for the rest of the domains
#echo $ssl_exec
$ssl_exec