mirror of
https://github.com/plantroon/acme.sh.git
synced 2024-11-15 19:01:44 +00:00
commit
645135bf56
@ -1,5 +1,5 @@
|
|||||||
language: shell
|
language: shell
|
||||||
dist: trusty
|
dist: bionic
|
||||||
|
|
||||||
os:
|
os:
|
||||||
- linux
|
- linux
|
||||||
|
@ -43,7 +43,7 @@ vault_cli_deploy() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
VAULT_CMD=$(which vault)
|
VAULT_CMD=$(command -v vault)
|
||||||
if [ ! $? ]; then
|
if [ ! $? ]; then
|
||||||
_err "cannot find vault binary!"
|
_err "cannot find vault binary!"
|
||||||
return 1
|
return 1
|
||||||
|
@ -69,7 +69,7 @@ dns_cloudns_rm() {
|
|||||||
for i in $(echo "$response" | tr '{' "\n" | grep "$record"); do
|
for i in $(echo "$response" | tr '{' "\n" | grep "$record"); do
|
||||||
record_id=$(echo "$i" | tr ',' "\n" | grep -E '^"id"' | sed -re 's/^\"id\"\:\"([0-9]+)\"$/\1/g')
|
record_id=$(echo "$i" | tr ',' "\n" | grep -E '^"id"' | sed -re 's/^\"id\"\:\"([0-9]+)\"$/\1/g')
|
||||||
|
|
||||||
if [ ! -z "$record_id" ]; then
|
if [ -n "$record_id" ]; then
|
||||||
_debug zone "$zone"
|
_debug zone "$zone"
|
||||||
_debug host "$host"
|
_debug host "$host"
|
||||||
_debug record "$record"
|
_debug record "$record"
|
||||||
@ -91,7 +91,7 @@ dns_cloudns_rm() {
|
|||||||
|
|
||||||
#################### Private functions below ##################################
|
#################### Private functions below ##################################
|
||||||
_dns_cloudns_init_check() {
|
_dns_cloudns_init_check() {
|
||||||
if [ ! -z "$CLOUDNS_INIT_CHECK_COMPLETED" ]; then
|
if [ -n "$CLOUDNS_INIT_CHECK_COMPLETED" ]; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -164,7 +164,7 @@ _dns_cloudns_http_api_call() {
|
|||||||
_debug CLOUDNS_SUB_AUTH_ID "$CLOUDNS_SUB_AUTH_ID"
|
_debug CLOUDNS_SUB_AUTH_ID "$CLOUDNS_SUB_AUTH_ID"
|
||||||
_debug CLOUDNS_AUTH_PASSWORD "$CLOUDNS_AUTH_PASSWORD"
|
_debug CLOUDNS_AUTH_PASSWORD "$CLOUDNS_AUTH_PASSWORD"
|
||||||
|
|
||||||
if [ ! -z "$CLOUDNS_SUB_AUTH_ID" ]; then
|
if [ -n "$CLOUDNS_SUB_AUTH_ID" ]; then
|
||||||
auth_user="sub-auth-id=$CLOUDNS_SUB_AUTH_ID"
|
auth_user="sub-auth-id=$CLOUDNS_SUB_AUTH_ID"
|
||||||
else
|
else
|
||||||
auth_user="auth-id=$CLOUDNS_AUTH_ID"
|
auth_user="auth-id=$CLOUDNS_AUTH_ID"
|
||||||
|
@ -66,7 +66,7 @@ _cyon_load_credentials() {
|
|||||||
_debug "Save credentials to account.conf"
|
_debug "Save credentials to account.conf"
|
||||||
_saveaccountconf CY_Username "${CY_Username}"
|
_saveaccountconf CY_Username "${CY_Username}"
|
||||||
_saveaccountconf CY_Password_B64 "$CY_Password_B64"
|
_saveaccountconf CY_Password_B64 "$CY_Password_B64"
|
||||||
if [ ! -z "${CY_OTP_Secret}" ]; then
|
if [ -n "${CY_OTP_Secret}" ]; then
|
||||||
_saveaccountconf CY_OTP_Secret "$CY_OTP_Secret"
|
_saveaccountconf CY_OTP_Secret "$CY_OTP_Secret"
|
||||||
else
|
else
|
||||||
_clearaccountconf CY_OTP_Secret
|
_clearaccountconf CY_OTP_Secret
|
||||||
@ -164,7 +164,7 @@ _cyon_login() {
|
|||||||
# todo: instead of just checking if the env variable is defined, check if we actually need to do a 2FA auth request.
|
# todo: instead of just checking if the env variable is defined, check if we actually need to do a 2FA auth request.
|
||||||
|
|
||||||
# 2FA authentication with OTP?
|
# 2FA authentication with OTP?
|
||||||
if [ ! -z "${CY_OTP_Secret}" ]; then
|
if [ -n "${CY_OTP_Secret}" ]; then
|
||||||
_info " - Authorising with OTP code..."
|
_info " - Authorising with OTP code..."
|
||||||
|
|
||||||
if ! _exists oathtool; then
|
if ! _exists oathtool; then
|
||||||
|
@ -122,12 +122,12 @@ dns_dgon_rm() {
|
|||||||
## check for what we are looking for: "type":"A","name":"$_sub_domain"
|
## check for what we are looking for: "type":"A","name":"$_sub_domain"
|
||||||
record="$(echo "$domain_list" | _egrep_o "\"id\"\s*\:\s*\"*[0-9]+\"*[^}]*\"name\"\s*\:\s*\"$_sub_domain\"[^}]*\"data\"\s*\:\s*\"$txtvalue\"")"
|
record="$(echo "$domain_list" | _egrep_o "\"id\"\s*\:\s*\"*[0-9]+\"*[^}]*\"name\"\s*\:\s*\"$_sub_domain\"[^}]*\"data\"\s*\:\s*\"$txtvalue\"")"
|
||||||
|
|
||||||
if [ ! -z "$record" ]; then
|
if [ -n "$record" ]; then
|
||||||
|
|
||||||
## we found records
|
## we found records
|
||||||
rec_ids="$(echo "$record" | _egrep_o "id\"\s*\:\s*\"*[0-9]+" | _egrep_o "[0-9]+")"
|
rec_ids="$(echo "$record" | _egrep_o "id\"\s*\:\s*\"*[0-9]+" | _egrep_o "[0-9]+")"
|
||||||
_debug rec_ids "$rec_ids"
|
_debug rec_ids "$rec_ids"
|
||||||
if [ ! -z "$rec_ids" ]; then
|
if [ -n "$rec_ids" ]; then
|
||||||
echo "$rec_ids" | while IFS= read -r rec_id; do
|
echo "$rec_ids" | while IFS= read -r rec_id; do
|
||||||
## delete the record
|
## delete the record
|
||||||
## delete URL for removing the one we dont want
|
## delete URL for removing the one we dont want
|
||||||
@ -218,7 +218,7 @@ _get_base_domain() {
|
|||||||
## we got part of a domain back - grep it out
|
## we got part of a domain back - grep it out
|
||||||
found="$(echo "$domain_list" | _egrep_o "\"name\"\s*\:\s*\"$_domain\"")"
|
found="$(echo "$domain_list" | _egrep_o "\"name\"\s*\:\s*\"$_domain\"")"
|
||||||
## check if it exists
|
## check if it exists
|
||||||
if [ ! -z "$found" ]; then
|
if [ -n "$found" ]; then
|
||||||
## exists - exit loop returning the parts
|
## exists - exit loop returning the parts
|
||||||
sub_point=$(_math $i - 1)
|
sub_point=$(_math $i - 1)
|
||||||
_sub_domain=$(printf "%s" "$fulldomain" | cut -d . -f 1-"$sub_point")
|
_sub_domain=$(printf "%s" "$fulldomain" | cut -d . -f 1-"$sub_point")
|
||||||
|
@ -25,7 +25,7 @@ dns_yandex_add() {
|
|||||||
_PDD_get_record_ids || return 1
|
_PDD_get_record_ids || return 1
|
||||||
_debug "Record_ids: $record_ids"
|
_debug "Record_ids: $record_ids"
|
||||||
|
|
||||||
if [ ! -z "$record_ids" ]; then
|
if [ -n "$record_ids" ]; then
|
||||||
_info "All existing $subdomain records from $domain will be removed at the very end."
|
_info "All existing $subdomain records from $domain will be removed at the very end."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user