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
598f29b7
Commit
598f29b7
authored
Mar 21, 2020
by
ThiloGa
Browse files
doing shellcheck staff
parent
f61f2d6e
Changes
1
Show whitespace changes
Inline
Side-by-side
dnsapi/dns_nm.sh
View file @
598f29b7
...
...
@@ -16,7 +16,6 @@
namemaster_api
=
"https://namemaster.de/api/api.php"
dns_nm_add
()
{
fulldomain
=
$1
txt_value
=
$2
...
...
@@ -35,7 +34,6 @@ dns_nm_add() {
_saveaccountconf_mutable NM_user
"
$NM_user
"
_saveaccountconf_mutable NM_sha256
"
$NM_sha256
"
_debug
"First detect the root zone"
if
!
_get_root
"
$fulldomain
"
;
then
_err
"invalid domain"
"
$fulldomain
"
...
...
@@ -46,8 +44,8 @@ dns_nm_add() {
get
=
"
$namemaster_api
?User=
$NM_user
&Password=
$NM_sha256
&Antwort=csv&Typ=ACME&zone=
$zone
&hostname=
$fulldomain
&TXT=
$txt_value
&Action=Auto&Lifetime=3600"
if
!
erg
=
"
$(
_get
"
$get
"
)
"
then
if
!
erg
=
"
$(
_get
"
$get
"
)
"
;
then
_err
"error Adding
$fulldomain
TXT:
$txt_value
"
return
1
fi
...
...
@@ -77,12 +75,10 @@ dns_nm_rm() {
return
1
fi
zone
=
"
$(
echo
"
$fulldomain
"
| _egrep_o
"[^.]+.[^.]+$"
)
"
get
=
"
$namemaster_api
?User=
$NM_user
&Password=
$NM_sha256
&Antwort=csv&Typ=TXT&Zone=
$zone
&hostname=
$fulldomain
&TXT=
$txt_value
&Action=Delete_IN"
if
!
erg
=
"
$(
_get
"
$get
"
)
"
then
if
!
erg
=
"
$(
_get
"
$get
"
)
"
;
then
_err
"error Deleting
$fulldomain
TXT:
$txt_value
"
return
1
fi
...
...
@@ -99,15 +95,13 @@ dns_nm_rm() {
}
_get_root
()
{
domain
=
$1
get
=
"
$namemaster_api
?User=
$NM_user
&Password=
$NM_sha256
&Typ=acme&hostname=
$domain
&Action=getzone&antwort=csv"
if
!
zone
=
"
$(
_get
"
$get
"
)
"
then
if
!
zone
=
"
$(
_get
"
$get
"
)
"
;
then
_err
"error getting Zone"
return
1
else
...
...
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