diff --git a/cert-up.sh b/cert-up.sh index 00cbf64..b9bebc0 100644 --- a/cert-up.sh +++ b/cert-up.sh @@ -29,7 +29,8 @@ installAcme () { mkdir -p ${TEMP_PATH} cd ${TEMP_PATH} echo 'begin downloading acme.sh tool...' - ACME_SH_ADDRESS=`curl -L https://cdn.jsdelivr.net/gh/andyzhshg/syno-acme@master/acme.sh.address` + ACME_SH_VERSION=$(wget -qO- -t1 -T2 "https://api.github.com/repos/acmesh-official/acme.sh/releases/latest" | grep "tag_name" | head -n 1 | awk -F ":" '{print $2}' | sed 's/\"//g;s/,//g;s/ //g') + ACME_SH_ADDRESS=https://ghproxy.com/https://github.com/acmesh-official/acme.sh/archive/${ACME_SH_VERSION}.tar.gz SRC_TAR_NAME=acme.sh.tar.gz curl -L -o ${SRC_TAR_NAME} ${ACME_SH_ADDRESS} SRC_NAME=`tar -tzf ${SRC_TAR_NAME} | head -1 | cut -f1 -d"/"` @@ -48,7 +49,7 @@ generateCrt () { source config echo 'begin updating default cert by acme.sh tool' source ${ACME_BIN_PATH}/acme.sh.env - ${ACME_BIN_PATH}/acme.sh --force --log --issue --dns ${DNS} --dnssleep ${DNS_SLEEP} -d "${DOMAIN}" -d "*.${DOMAIN}" + ${ACME_BIN_PATH}/acme.sh --force --log --issue --server letsencrypt --dns ${DNS} --dnssleep ${DNS_SLEEP} -d "${DOMAIN}" -d "*.${DOMAIN}" ${ACME_BIN_PATH}/acme.sh --force --installcert -d ${DOMAIN} -d *.${DOMAIN} \ --certpath ${CRT_PATH}/cert.pem \ --key-file ${CRT_PATH}/privkey.pem \