Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
4f32f128
Unverified
Commit
4f32f128
authored
Aug 31, 2022
by
neil
Committed by
GitHub
Aug 31, 2022
Browse files
Merge pull request #4190 from arnebjarne/dns_cpanel_multidomain
Dns cpanel multidomain
parents
3dde83d8
2fb9c923
Changes
1
Hide whitespace changes
Inline
Side-by-side
dnsapi/dns_cpanel.sh
View file @
4f32f128
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
# cPanel_Hostname=hostname
# cPanel_Hostname=hostname
#
#
# Usage: add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs"
# Usage: add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs"
# Used to add txt record
# Used to add txt record
dns_cpanel_add
()
{
dns_cpanel_add
()
{
fulldomain
=
$1
fulldomain
=
$1
...
@@ -120,7 +121,7 @@ _myget() {
...
@@ -120,7 +121,7 @@ _myget() {
_get_root
()
{
_get_root
()
{
_myget
'json-api/cpanel?cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=ZoneEdit&cpanel_jsonapi_func=fetchzones'
_myget
'json-api/cpanel?cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=ZoneEdit&cpanel_jsonapi_func=fetchzones'
_domains
=
$(
echo
"
$_result
"
|
sed
's/.*\(zones.*\[\).*/\1/
'
|
cut
-d
':'
-f
2
|
sed
's/"//g'
|
sed
's/{//g'
)
_domains
=
$(
echo
"
$_result
"
|
_egrep_o
'"[a-z0-9\.\-]*":\["; cPanel first
'
|
cut
-d
':'
-f
1
|
sed
's/"//g'
|
sed
's/{//g'
)
_debug
"_result is:
$_result
"
_debug
"_result is:
$_result
"
_debug
"_domains is:
$_domains
"
_debug
"_domains is:
$_domains
"
if
[
-z
"
$_domains
"
]
;
then
if
[
-z
"
$_domains
"
]
;
then
...
@@ -146,7 +147,7 @@ _findentry() {
...
@@ -146,7 +147,7 @@ _findentry() {
_debug
"In _findentry"
_debug
"In _findentry"
#returns id of dns entry, if it exists
#returns id of dns entry, if it exists
_myget
"json-api/cpanel?cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=ZoneEdit&cpanel_jsonapi_func=fetchzone_records&domain=
$_domain
"
_myget
"json-api/cpanel?cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=ZoneEdit&cpanel_jsonapi_func=fetchzone_records&domain=
$_domain
"
_id
=
$(
echo
"
$_result
"
|
sed
"s/.*
\(
line.*
$fulldomain
.*
$txtvalue
\)
.*/
\1
/"
|
cut
-d
':'
-f
2
|
cut
-d
'
,
'
-f
1
)
_id
=
$(
echo
"
$_result
"
|
sed
-e
"s/},{/},
\n
{/g"
|
grep
"
$fulldomain
"
|
grep
"
$txtvalue
"
| _egrep_o
'line":[0-9]+'
|
cut
-d
'
:
'
-f
2
)
_debug
"_result is:
$_result
"
_debug
"_result is:
$_result
"
_debug
"fulldomain. is
$fulldomain
."
_debug
"fulldomain. is
$fulldomain
."
_debug
"txtvalue is
$txtvalue
"
_debug
"txtvalue is
$txtvalue
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment