Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
68debc47
Commit
68debc47
authored
Oct 03, 2021
by
Bjarne Saltbaek
Browse files
First jq rework
parent
6a7f993a
Changes
1
Show whitespace changes
Inline
Side-by-side
dnsapi/dns_cpanel.sh
View file @
68debc47
...
@@ -11,8 +11,6 @@
...
@@ -11,8 +11,6 @@
# cPanel_Apitoken=apitoken
# cPanel_Apitoken=apitoken
# cPanel_Hostname=hostname
# cPanel_Hostname=hostname
#
#
# Note: the program 'jq' must be availble on your system
# 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
()
{
...
@@ -117,7 +115,7 @@ _myget() {
...
@@ -117,7 +115,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
"
|
jq
'.cpanelresult.data[]| {zones}| .zones| keys'
|
sed
-e
's/"//g'
-e
's/,//g'
-e
's/\[//g'
-e
's/\]//g'
-e
'/^$/d'
-e
's/[[:space:]]//g'
)
_domains
=
$(
echo
"
$_result
"
|
cut
-d
':'
-f9
|
sed
-e
's/"//g'
-e
'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
...
...
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