fix getroot with multiple dns zones

This commit is contained in:
martgras 2018-01-24 09:59:05 +01:00 committed by GitHub
parent c82cd90ed6
commit 3fdbbafcb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,9 +1,8 @@
#!/usr/bin/env sh
######## Public functions #####################
# Usage: add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs"
# Usage: add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs"
# Used to add txt record
#
# Ref: https://docs.microsoft.com/en-us/rest/api/dns/recordsets/createorupdate
@ -23,7 +22,7 @@ dns_azure_add()
AZUREDNS_TENANTID=""
AZUREDNS_APPID=""
AZUREDNS_CLIENTSECRET=""
_err "You didn't specify the Azure Subscription ID "
_err "You didn't specify the Azure Subscription ID "
return 1
fi
@ -32,7 +31,7 @@ dns_azure_add()
AZUREDNS_TENANTID=""
AZUREDNS_APPID=""
AZUREDNS_CLIENTSECRET=""
_err "You didn't specify then Azure Tenant ID "
_err "You didn't specify then Azure Tenant ID "
return 1
fi
@ -41,7 +40,7 @@ dns_azure_add()
AZUREDNS_TENANTID=""
AZUREDNS_APPID=""
AZUREDNS_CLIENTSECRET=""
_err "You didn't specify the Azure App ID"
_err "You didn't specify the Azure App ID"
return 1
fi
@ -50,7 +49,7 @@ dns_azure_add()
AZUREDNS_TENANTID=""
AZUREDNS_APPID=""
AZUREDNS_CLIENTSECRET=""
_err "You didn't specify the Azure Client Secret"
_err "You didn't specify the Azure Client Secret"
return 1
fi
#save account details to account conf file.
@ -97,7 +96,7 @@ dns_azure_rm()
AZUREDNS_TENANTID=""
AZUREDNS_APPID=""
AZUREDNS_CLIENTSECRET=""
_err "You didn't specify the Azure Subscription ID "
_err "You didn't specify the Azure Subscription ID "
return 1
fi
@ -106,7 +105,7 @@ dns_azure_rm()
AZUREDNS_TENANTID=""
AZUREDNS_APPID=""
AZUREDNS_CLIENTSECRET=""
_err "You didn't specify the Azure Tenant ID "
_err "You didn't specify the Azure Tenant ID "
return 1
fi
@ -115,7 +114,7 @@ dns_azure_rm()
AZUREDNS_TENANTID=""
AZUREDNS_APPID=""
AZUREDNS_CLIENTSECRET=""
_err "You didn't specify the Azure App ID"
_err "You didn't specify the Azure App ID"
return 1
fi
@ -124,7 +123,7 @@ dns_azure_rm()
AZUREDNS_TENANTID=""
AZUREDNS_APPID=""
AZUREDNS_CLIENTSECRET=""
_err "You didn't specify Azure Client Secret"
_err "You didn't specify Azure Client Secret"
return 1
fi
@ -225,7 +224,7 @@ _get_root() {
fi
if _contains "$response" "\"name\":\"$h\"" >/dev/null; then
_domain_id=$(printf "%s\n" "$response" | _egrep_o "\[.\"id\":\"[^\"]*\"" | head -n 1 | cut -d : -f 2 | tr -d \")
_domain_id=$(printf "%s\n" "$response" | _egrep_o "\{\"id\":\"[^\"]*$h\"" | head -n 1 | cut -d : -f 2 | tr -d \")
if [ "$_domain_id" ]; then
_sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
_domain=$h
@ -238,4 +237,3 @@ _get_root() {
done
return 1
}