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
f3a0a253
Commit
f3a0a253
authored
Feb 08, 2022
by
Andreas Scherer
Browse files
FIX dns_udr api: ttl, xargs, cleanup
parent
a7f2d89e
Changes
1
Show whitespace changes
Inline
Side-by-side
dnsapi/dns_udr.sh
View file @
f3a0a253
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
#
#
UDR_API
=
"https://api.domainreselling.de/api/call.cgi"
UDR_API
=
"https://api.domainreselling.de/api/call.cgi"
UDR_TTL
=
"30
0
"
UDR_TTL
=
"30"
######## Public functions #####################
######## Public functions #####################
...
@@ -19,7 +19,7 @@ UDR_TTL="300"
...
@@ -19,7 +19,7 @@ UDR_TTL="300"
dns_udr_add
()
{
dns_udr_add
()
{
fulldomain
=
$1
fulldomain
=
$1
txtvalue
=
$2
txtvalue
=
$2
export
txtvalue
UDR_USER
=
"
${
UDR_USER
:-
$(
_readaccountconf_mutable UDR_USER
)
}
"
UDR_USER
=
"
${
UDR_USER
:-
$(
_readaccountconf_mutable UDR_USER
)
}
"
UDR_PASS
=
"
${
UDR_PASS
:-
$(
_readaccountconf_mutable UDR_PASS
)
}
"
UDR_PASS
=
"
${
UDR_PASS
:-
$(
_readaccountconf_mutable UDR_PASS
)
}
"
if
[
-z
"
$UDR_USER
"
]
||
[
-z
"
$UDR_PASS
"
]
;
then
if
[
-z
"
$UDR_USER
"
]
||
[
-z
"
$UDR_PASS
"
]
;
then
...
@@ -64,7 +64,7 @@ dns_udr_add() {
...
@@ -64,7 +64,7 @@ dns_udr_add() {
dns_udr_rm
()
{
dns_udr_rm
()
{
fulldomain
=
$1
fulldomain
=
$1
txtvalue
=
$2
txtvalue
=
$2
export
txtvalue
UDR_USER
=
"
${
UDR_USER
:-
$(
_readaccountconf_mutable UDR_USER
)
}
"
UDR_USER
=
"
${
UDR_USER
:-
$(
_readaccountconf_mutable UDR_USER
)
}
"
UDR_PASS
=
"
${
UDR_PASS
:-
$(
_readaccountconf_mutable UDR_PASS
)
}
"
UDR_PASS
=
"
${
UDR_PASS
:-
$(
_readaccountconf_mutable UDR_PASS
)
}
"
if
[
-z
"
$UDR_USER
"
]
||
[
-z
"
$UDR_PASS
"
]
;
then
if
[
-z
"
$UDR_USER
"
]
||
[
-z
"
$UDR_PASS
"
]
;
then
...
@@ -145,8 +145,8 @@ _udr_rest() {
...
@@ -145,8 +145,8 @@ _udr_rest() {
_debug data
"
${
data
}
"
_debug data
"
${
data
}
"
response
=
"
$(
_post
"
${
data
}
"
"
${
UDR_API
}
?s_login=
${
UDR_USER
}
&s_pw=
${
UDR_PASS
}
"
""
"POST"
)
"
response
=
"
$(
_post
"
${
data
}
"
"
${
UDR_API
}
?s_login=
${
UDR_USER
}
&s_pw=
${
UDR_PASS
}
"
""
"POST"
)
"
_code
=
$(
echo
"
$response
"
| _egrep_o
"code = ([0-9]+)"
| _head_n 1 |
cut
-d
=
-f
2 |
xargs
)
_code
=
$(
echo
"
$response
"
| _egrep_o
"code = ([0-9]+)"
| _head_n 1 |
cut
-d
=
-f
2 |
sed
-e
's/^[[:space:]]*//'
-e
's/[[:space:]]*$//'
)
_description
=
$(
echo
"
$response
"
| _egrep_o
"description = .*"
| _head_n 1 |
cut
-d
=
-f
2 |
xargs
)
_description
=
$(
echo
"
$response
"
| _egrep_o
"description = .*"
| _head_n 1 |
cut
-d
=
-f
2 |
sed
-e
's/^[[:space:]]*//'
-e
's/[[:space:]]*$//'
)
_debug response_code
"
$_code
"
_debug response_code
"
$_code
"
_debug response_description
"
$_description
"
_debug response_description
"
$_description
"
...
...
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