Update dns_jamotech.sh

This commit is contained in:
Jamo 2021-11-29 21:55:02 +00:00 committed by GitHub
parent b190e45b01
commit 863153da78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,17 +1,14 @@
#!/usr/bin/env sh #!/usr/bin/env sh
#Here is a sample custom api script. # JamoTech Customer Domain amce Helper
#This file name is "dns_myapi.sh" # This script is intended to be run via
#So, here must be a method dns_myapi_add() # acme.sh on managed customer systems
#Which will be called by acme.sh to add the txt record to your api system. # to allow customers to create and renew
#returns 0 means success, otherwise error. # SSL certificates on their client
# # subdomain e.g (client.jamo.tech)
#Author: Neilpang # without the need for support staff
#Report Bugs here: https://github.com/acmesh-official/acme.sh # to create TXT records.
#
######## Public functions #####################
# Please Read this guide first: https://github.com/acmesh-official/acme.sh/wiki/DNS-API-Dev-Guide
# API Calls to be made # API Calls to be made
# _get("https://api.corp-jamo.tech/dns/v1/records/exists.php?access=accesskey&hostname=subdomain&target=10.8.0.1&type=A") # _get("https://api.corp-jamo.tech/dns/v1/records/exists.php?access=accesskey&hostname=subdomain&target=10.8.0.1&type=A")
@ -21,7 +18,6 @@
# _get("https://api.corp-jamo.tech/dns/v1/records/remove.php?access=accesskey&hostname=subdomain&target=10.8.0.1&type=A") # _get("https://api.corp-jamo.tech/dns/v1/records/remove.php?access=accesskey&hostname=subdomain&target=10.8.0.1&type=A")
# _get("https://api.corp-jamo.tech/dns/v1/records/remove.php?access=accesskey&hostname=_acme-challenge.subdomain&target=ACMEKEY&type=TXT") # _get("https://api.corp-jamo.tech/dns/v1/records/remove.php?access=accesskey&hostname=_acme-challenge.subdomain&target=ACMEKEY&type=TXT")
#Usage: dns_myapi_add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs"
dns_jamotech_add() { dns_jamotech_add() {
fulldomain=$1 fulldomain=$1
txtvalue=$2 txtvalue=$2
@ -49,8 +45,6 @@ dns_jamotech_add() {
} }
#Usage: fulldomain txtvalue
#Remove the txt record after validation.
dns_jamotech_rm() { dns_jamotech_rm() {
fulldomain=$1 fulldomain=$1
txtvalue=$2 txtvalue=$2
@ -81,11 +75,6 @@ dns_jamotech_rm() {
} }
#################### Private functions below ################################## #################### Private functions below ##################################
# _acme-challenge.www.domain.com
# returns
# _domain=domain.com
# _txtdomain=_acme-challenge.www
# _adomain=www
_get_root() { _get_root() {
domain=$fulldomain domain=$fulldomain