mirror of
https://github.com/acmesh-official/acme.sh.git
synced 2025-05-09 15:42:43 +00:00
Update dns_kappernet.sh
added missing functions
This commit is contained in:
parent
e97e8337a3
commit
c4af37beed
@ -6,7 +6,6 @@
|
|||||||
#
|
#
|
||||||
# 20171107 - v1: initial version uploaded to GitHub Project Neilpang/acme.sh
|
# 20171107 - v1: initial version uploaded to GitHub Project Neilpang/acme.sh
|
||||||
|
|
||||||
|
|
||||||
#KAPPERNETDNS_Key="yourKAPPERNETapikey"
|
#KAPPERNETDNS_Key="yourKAPPERNETapikey"
|
||||||
#KAPPERNETDNS_Secret="yourKAPPERNETapisecret"
|
#KAPPERNETDNS_Secret="yourKAPPERNETapisecret"
|
||||||
KAPPERNETDNS_Api="https://dnspanel.kapper.net/API/1.1?APIKey=$KAPPERNETDNS_Key&APISecret=$KAPPERNETDNS_Secret"
|
KAPPERNETDNS_Api="https://dnspanel.kapper.net/API/1.1?APIKey=$KAPPERNETDNS_Key&APISecret=$KAPPERNETDNS_Secret"
|
||||||
@ -92,3 +91,58 @@ dns_kappernet_rm()
|
|||||||
fi
|
fi
|
||||||
_err "Problem creating the TXT record/Fehler beim Anlegen eines TXT records"
|
_err "Problem creating the TXT record/Fehler beim Anlegen eines TXT records"
|
||||||
}
|
}
|
||||||
|
#################### Private functions below ##################################
|
||||||
|
# called with hostname
|
||||||
|
# e.g._acme-challenge.www.domain.com returns
|
||||||
|
# _sub_domain=_acme-challenge.www
|
||||||
|
# _domain=domain.com
|
||||||
|
_get_root()
|
||||||
|
{
|
||||||
|
domain=$1
|
||||||
|
i=2
|
||||||
|
p=1
|
||||||
|
while true; do
|
||||||
|
h=$(printf "%s" "$domain" | cut -d . -f $i-100)
|
||||||
|
if [ -z "$h" ]; then
|
||||||
|
#not valid
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
if ! _kappernet_api GET "action=list&subject=$h"; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
if _contains "$response" '"OK":false'; then
|
||||||
|
_debug "$h not found"
|
||||||
|
else
|
||||||
|
_sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
|
||||||
|
_domain="$h"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
p="$i"
|
||||||
|
i=$(_math "$i" + 1)
|
||||||
|
done
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
################################################################################
|
||||||
|
# calls the kapper.net DNS Panel API
|
||||||
|
# with
|
||||||
|
# method
|
||||||
|
# param
|
||||||
|
_kappernet_api()
|
||||||
|
{
|
||||||
|
method=$1
|
||||||
|
param="$2"
|
||||||
|
|
||||||
|
_debug param "PARAMETER=$param"
|
||||||
|
url="$KAPPERNETDNS_Api&$param"
|
||||||
|
_debug url "URL=$url"
|
||||||
|
|
||||||
|
if [ "$method" = "GET" ]; then
|
||||||
|
response="$(_get "$url")"
|
||||||
|
else
|
||||||
|
_err "Unsupported method"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
_debug2 response "$response"
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user