mirror of
https://github.com/acmesh-official/acme.sh.git
synced 2026-01-07 15:12:10 +08:00
init dnsapi
This commit is contained in:
61
le.sh
61
le.sh
@@ -320,7 +320,6 @@ _initpath() {
|
||||
if [ -z "$CA_CERT_PATH" ] ; then
|
||||
CA_CERT_PATH="$WORKING_DIR/$domain/ca.cer"
|
||||
fi
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -619,12 +618,44 @@ issue() {
|
||||
_debug txt "$txt"
|
||||
#dns
|
||||
#1. check use api
|
||||
_err "Add the following TXT record:"
|
||||
_err "Domain: $txtdomain"
|
||||
_err "TXT value: $txt"
|
||||
_err "Please be aware that you prepend _acme-challenge. before your domain"
|
||||
_err "so the resulting subdomain will be: $txtdomain"
|
||||
#dnsadded='1'
|
||||
d_api=""
|
||||
if [ -f "$WORKING_DIR/$d/$Le_Webroot" ] ; then
|
||||
d_api="$WORKING_DIR/$d/$Le_Webroot"
|
||||
elif [ -f "$WORKING_DIR/$d/$Le_Webroot.sh" ] ; then
|
||||
d_api="$WORKING_DIR/$d/$Le_Webroot.sh"
|
||||
elif [ -f "$WORKING_DIR/$Le_Webroot" ] ; then
|
||||
d_api="$WORKING_DIR/$Le_Webroot"
|
||||
elif [ -f "$WORKING_DIR/$Le_Webroot.sh" ] ; then
|
||||
d_api="$WORKING_DIR/$Le_Webroot.sh"
|
||||
fi
|
||||
|
||||
if [ "$d_api" ]; then
|
||||
_info "Found domain api file: $d_api"
|
||||
else
|
||||
_err "Add the following TXT record:"
|
||||
_err "Domain: $txtdomain"
|
||||
_err "TXT value: $txt"
|
||||
_err "Please be aware that you prepend _acme-challenge. before your domain"
|
||||
_err "so the resulting subdomain will be: $txtdomain"
|
||||
continue
|
||||
fi
|
||||
|
||||
if ! source $d_api ; then
|
||||
_err "Load file $d_api error. Please check your api file and try again."
|
||||
return 1
|
||||
fi
|
||||
|
||||
addcommand="$Le_Webroot-add"
|
||||
if ! command -v $addcommand ; then
|
||||
_err "It seems that your api file is not correct, it must have a function named: $Le_Webroot"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if ! $addcommand $txtdomain $txt ; then
|
||||
_err "Error add txt for domain:$txtdomain"
|
||||
return 1
|
||||
fi
|
||||
dnsadded='1'
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -806,13 +837,17 @@ renew() {
|
||||
|
||||
_initpath $Le_Domain
|
||||
|
||||
if [ -f "$DOMAIN_CONF" ] ; then
|
||||
source "$DOMAIN_CONF"
|
||||
if [ -z "$FORCE" ] && [ "$Le_NextRenewTime" ] && [ "$(date -u "+%s" )" -lt "$Le_NextRenewTime" ] ; then
|
||||
_info "Skip, Next renewal time is: $Le_NextRenewTimeStr"
|
||||
return 2
|
||||
fi
|
||||
if [ ! -f "$DOMAIN_CONF" ] ; then
|
||||
_err "$Le_Domain is not a issued domain, skip."
|
||||
return 1;
|
||||
fi
|
||||
|
||||
source "$DOMAIN_CONF"
|
||||
if [ -z "$FORCE" ] && [ "$Le_NextRenewTime" ] && [ "$(date -u "+%s" )" -lt "$Le_NextRenewTime" ] ; then
|
||||
_info "Skip, Next renewal time is: $Le_NextRenewTimeStr"
|
||||
return 2
|
||||
fi
|
||||
|
||||
IS_RENEW="1"
|
||||
issue "$Le_Webroot" "$Le_Domain" "$Le_Alt" "$Le_Keylength" "$Le_RealCertPath" "$Le_RealKeyPath" "$Le_RealCACertPath" "$Le_ReloadCmd"
|
||||
IS_RENEW=""
|
||||
|
||||
Reference in New Issue
Block a user