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
Hide whitespace changes
Inline
Side-by-side
dnsapi/dns_nm.sh
View file @
598f29b7
...
@@ -16,7 +16,6 @@
...
@@ -16,7 +16,6 @@
namemaster_api
=
"https://namemaster.de/api/api.php"
namemaster_api
=
"https://namemaster.de/api/api.php"
dns_nm_add
()
{
dns_nm_add
()
{
fulldomain
=
$1
fulldomain
=
$1
txt_value
=
$2
txt_value
=
$2
...
@@ -35,7 +34,6 @@ dns_nm_add() {
...
@@ -35,7 +34,6 @@ dns_nm_add() {
_saveaccountconf_mutable NM_user
"
$NM_user
"
_saveaccountconf_mutable NM_user
"
$NM_user
"
_saveaccountconf_mutable NM_sha256
"
$NM_sha256
"
_saveaccountconf_mutable NM_sha256
"
$NM_sha256
"
_debug
"First detect the root zone"
_debug
"First detect the root zone"
if
!
_get_root
"
$fulldomain
"
;
then
if
!
_get_root
"
$fulldomain
"
;
then
_err
"invalid domain"
"
$fulldomain
"
_err
"invalid domain"
"
$fulldomain
"
...
@@ -46,8 +44,8 @@ dns_nm_add() {
...
@@ -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"
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
"
_err
"error Adding
$fulldomain
TXT:
$txt_value
"
return
1
return
1
fi
fi
...
@@ -77,12 +75,10 @@ dns_nm_rm() {
...
@@ -77,12 +75,10 @@ dns_nm_rm() {
return
1
return
1
fi
fi
zone
=
"
$(
echo
"
$fulldomain
"
| _egrep_o
"[^.]+.[^.]+$"
)
"
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"
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
"
)
"
if
!
erg
=
"
$(
_get
"
$get
"
)
"
;
then
then
_err
"error Deleting
$fulldomain
TXT:
$txt_value
"
_err
"error Deleting
$fulldomain
TXT:
$txt_value
"
return
1
return
1
fi
fi
...
@@ -99,15 +95,13 @@ dns_nm_rm() {
...
@@ -99,15 +95,13 @@ dns_nm_rm() {
}
}
_get_root
()
{
_get_root
()
{
domain
=
$1
domain
=
$1
get
=
"
$namemaster_api
?User=
$NM_user
&Password=
$NM_sha256
&Typ=acme&hostname=
$domain
&Action=getzone&antwort=csv"
get
=
"
$namemaster_api
?User=
$NM_user
&Password=
$NM_sha256
&Typ=acme&hostname=
$domain
&Action=getzone&antwort=csv"
if
!
zone
=
"
$(
_get
"
$get
"
)
"
if
!
zone
=
"
$(
_get
"
$get
"
)
"
;
then
then
_err
"error getting Zone"
_err
"error getting Zone"
return
1
return
1
else
else
...
@@ -117,4 +111,4 @@ _get_root() {
...
@@ -117,4 +111,4 @@ _get_root() {
fi
fi
fi
fi
}
}
\ No newline at end of file
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