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
4715a1a5
Unverified
Commit
4715a1a5
authored
May 16, 2018
by
linux-insideDE
Committed by
GitHub
May 16, 2018
Browse files
satisfy shellcheck
parent
ed2ba6bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
dnsapi/dns_netcup.sh
View file @
4715a1a5
#!/usr/bin/env sh
#!/usr/bin/env sh
#developed by linux-insideDE
#developed by linux-insideDE
NC_Apikey
=
"
${
NC_Apikey
:-
$(
_readaccountconf_mutable NC_Apikey
)
}
"
NC_Apikey
=
"
${
NC_Apikey
:-
$(
_readaccountconf_mutable NC_Apikey
)
}
"
...
@@ -154,7 +152,8 @@ logout() {
...
@@ -154,7 +152,8 @@ logout() {
}
}
getRecords
()
{
getRecords
()
{
tmp2
=
$(
_post
"{
\"
action
\"
:
\"
infoDnsRecords
\"
,
\"
param
\"
: {
\"
apikey
\"
:
\"
$NC_Apikey
\"
,
\"
apisessionid
\"
:
\"
$sid
\"
,
\"
customernumber
\"
:
\"
$NC_CID
\"
,
\"
domainname
\"
:
\"
$1
\"
}}"
"
$end
"
""
"POST"
)
tmp2
=
$(
_post
"{
\"
action
\"
:
\"
infoDnsRecords
\"
,
\"
param
\"
: {
\"
apikey
\"
:
\"
$NC_Apikey
\"
,
\"
apisessionid
\"
:
\"
$sid
\"
,
\"
customernumber
\"
:
\"
$NC_CID
\"
,
\"
domainname
\"
:
\"
$1
\"
}}"
"
$end
"
""
"POST"
)
echo
$(
echo
"
$tmp2
"
|
sed
's/\[//g'
|
sed
's/\]//g'
|
sed
's/{\"serverrequestid\".*\"dnsrecords\"://g'
|
sed
's/},{/};{/g'
|
sed
's/{//g'
|
sed
's/}//g'
)
out
=
$(
echo
"
$tmp2
"
|
sed
's/\[//g'
|
sed
's/\]//g'
|
sed
's/{\"serverrequestid\".*\"dnsrecords\"://g'
|
sed
's/},{/};{/g'
|
sed
's/{//g'
|
sed
's/}//g'
)
echo
"
$out
"
_debug
"
$tmp2
"
_debug
"
$tmp2
"
if
[
"
$(
_getfield
"
$msg
"
"4"
|
sed
s/
\"
status
\"
:
\"
//g |
sed
s/
\"
//g
)
"
!=
"success"
]
;
then
if
[
"
$(
_getfield
"
$msg
"
"4"
|
sed
s/
\"
status
\"
:
\"
//g |
sed
s/
\"
//g
)
"
!=
"success"
]
;
then
_err
"
$msg
"
_err
"
$msg
"
...
...
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