mirror of
https://github.com/acmesh-official/acme.sh.git
synced 2025-05-03 20:32:45 +00:00
Update jamotech.sh to comply with shellcheck
Update jamotech.sh to comply with shellcheck
This commit is contained in:
parent
b69e93e69a
commit
26ae489efa
@ -1,14 +1,18 @@
|
|||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
# acme.sh JamoTech helper script
|
#Here is a sample custom api script.
|
||||||
# This is to be used on client systems and used by Ansible
|
#This file name is "dns_myapi.sh"
|
||||||
# to deploy SSL certificates on the jamo.tech domain to
|
#So, here must be a method dns_myapi_add()
|
||||||
# customer servers for web panels and the likes to their
|
#Which will be called by acme.sh to add the txt record to your api system.
|
||||||
# customer jamo.tech subdomain.
|
#returns 0 means success, otherwise error.
|
||||||
|
#
|
||||||
|
#Author: Neilpang
|
||||||
|
#Report Bugs here: https://github.com/acmesh-official/acme.sh
|
||||||
|
#
|
||||||
######## Public functions #####################
|
######## 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")
|
||||||
# _get("https://api.corp-jamo.tech/dns/v1/records/exists.php?access=accesskey&hostname=_acme-challenge.subdomain&target=ACMEKEY&type=TXT")
|
# _get("https://api.corp-jamo.tech/dns/v1/records/exists.php?access=accesskey&hostname=_acme-challenge.subdomain&target=ACMEKEY&type=TXT")
|
||||||
@ -80,10 +84,11 @@ dns_jamotech_rm() {
|
|||||||
|
|
||||||
|
|
||||||
#################### Private functions below ##################################
|
#################### Private functions below ##################################
|
||||||
# _acme-challenge.client.jamo.tech
|
# _acme-challenge.www.domain.com
|
||||||
# returns
|
# returns
|
||||||
# _txthost="_acme-challenge.client"
|
# _domain=domain.com
|
||||||
# _subhost="client"
|
# _txtdomain=_acme-challenge.www
|
||||||
|
# _adomain=www
|
||||||
|
|
||||||
|
|
||||||
_get_root() {
|
_get_root() {
|
||||||
@ -105,7 +110,7 @@ _get_root() {
|
|||||||
|
|
||||||
|
|
||||||
_check_record() {
|
_check_record() {
|
||||||
server_record="https://api.corp-jamo.tech/dns/v1/records/exists.php?access=$JTECH_KEY&hostname=$subdomain&target=$JTECH_ENDIP&type=A"
|
server_record="https://api.corp-jamo.tech/dns/v1/records/exists.php?access=$JTECH_KEY&hostname=$_subhost&target=$JTECH_ENDIP&type=A"
|
||||||
txt_record="https://api.corp-jamo.tech/dns/v1/records/exists.php?access=$JTECH_KEY&hostname=$txtdomain&target=$txtvalue&type=TXT"
|
txt_record="https://api.corp-jamo.tech/dns/v1/records/exists.php?access=$JTECH_KEY&hostname=$txtdomain&target=$txtvalue&type=TXT"
|
||||||
_debug "API ENDPOINTS $server_record $txt_record"
|
_debug "API ENDPOINTS $server_record $txt_record"
|
||||||
|
|
||||||
@ -135,7 +140,7 @@ _check_record() {
|
|||||||
|
|
||||||
_create_record() {
|
_create_record() {
|
||||||
_check_record
|
_check_record
|
||||||
server_record="https://api.corp-jamo.tech/dns/v1/records/add.php?access=$JTECH_KEY&hostname=$subdomain&target=$JTECH_ENDIP&type=A"
|
server_record="https://api.corp-jamo.tech/dns/v1/records/add.php?access=$JTECH_KEY&hostname=$_subhost&target=$JTECH_ENDIP&type=A"
|
||||||
txt_record="https://api.corp-jamo.tech/dns/v1/records/add.php?access=$JTECH_KEY&hostname=$txtdomain&target=$txtvalue&type=TXT"
|
txt_record="https://api.corp-jamo.tech/dns/v1/records/add.php?access=$JTECH_KEY&hostname=$txtdomain&target=$txtvalue&type=TXT"
|
||||||
_debug "API ENDPOINTS $server_record $txt_record"
|
_debug "API ENDPOINTS $server_record $txt_record"
|
||||||
|
|
||||||
@ -157,7 +162,7 @@ _create_record() {
|
|||||||
|
|
||||||
|
|
||||||
_remove_record() {
|
_remove_record() {
|
||||||
server_record="https://api.corp-jamo.tech/dns/v1/records/remove.php?access=$JTECH_KEY&hostname=$subdomain&target=$JTECH_ENDIP&type=A"
|
server_record="https://api.corp-jamo.tech/dns/v1/records/remove.php?access=$JTECH_KEY&hostname=$_subhost&target=$JTECH_ENDIP&type=A"
|
||||||
txt_record="https://api.corp-jamo.tech/dns/v1/records/remove.php?access=$JTECH_KEY&hostname=$txtdomain&target=$txtvalue&type=TXT"
|
txt_record="https://api.corp-jamo.tech/dns/v1/records/remove.php?access=$JTECH_KEY&hostname=$txtdomain&target=$txtvalue&type=TXT"
|
||||||
_debug "API ENDPOINTS $server_record $txt_record"
|
_debug "API ENDPOINTS $server_record $txt_record"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user