mirror of
https://github.com/acmesh-official/acme.sh.git
synced 2025-06-14 21:22:45 +00:00
Merge 9f34f242519fb4d813658f9539731bec656e9454 into 3d8b682380773f01df0e5abc2ef582c30c663010
This commit is contained in:
commit
5f44f476d6
52
dnsapi/dns_wexbo.sh
Normal file
52
dnsapi/dns_wexbo.sh
Normal file
@ -0,0 +1,52 @@
|
||||
#!/usr/bin/env sh
|
||||
# shellcheck disable=SC2034
|
||||
dns_wexbo_info='wexbo.com
|
||||
Site: wexbo.com
|
||||
Docs: github.com/acmesh-official/acme.sh/wiki/dnsapi2#dns_wexbo
|
||||
Options:
|
||||
WEXBO_TOKEN API Token
|
||||
Issues: github.com/acmesh-official/acme.sh/issues/6349
|
||||
Author: WEXBO s.r.o. <support@wexbo.com>
|
||||
'
|
||||
|
||||
WEXBO_URL="https://api.wexbo.com/v1/acme/";
|
||||
|
||||
######## Public functions #####################
|
||||
|
||||
#Usage: add _acme-challenge.www.domain.com "some_long_string_of_characters_go_here_from_lets_encrypt"
|
||||
dns_wexbo_add(){
|
||||
|
||||
fulldomain=$1;
|
||||
txtvalue=$2;
|
||||
|
||||
_wexbo_init
|
||||
|
||||
_info "Adding TXT record to ${fulldomain}";
|
||||
export _H1="Authorization: ${WEXBO_TOKEN}";
|
||||
response="$(_post "content=${txtvalue}" "${WEXBO_URL}${fulldomain}" "" "POST")";
|
||||
if _contains "${response}" '"result":true'; then return 0; fi
|
||||
_err "Error: ${response}"; return 1;
|
||||
|
||||
}
|
||||
|
||||
dns_wexbo_rm(){
|
||||
|
||||
fulldomain=$1;
|
||||
|
||||
_wexbo_init
|
||||
|
||||
_info "Deleting resource record ${fulldomain}"
|
||||
export _H1="Authorization: ${WEXBO_TOKEN}";
|
||||
response="$(_post "" "${WEXBO_URL}${fulldomain}" "" "DELETE")";
|
||||
if _contains "${response}" '"result":true'; then return 0; fi
|
||||
_err "Error: ${response}"; return 1;
|
||||
|
||||
}
|
||||
|
||||
_wexbo_init(){
|
||||
|
||||
WEXBO_TOKEN="${WEXBO_TOKEN:-$(_readaccountconf_mutable WEXBO_TOKEN)}";
|
||||
if [ -z "$WEXBO_TOKEN" ]; then WEXBO_TOKEN=""; _err "Please set WEXBO_TOKEN and try again."; return 1; fi
|
||||
_saveaccountconf_mutable WEXBO_TOKEN "$WEXBO_TOKEN";
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user