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
a9d88301
Commit
a9d88301
authored
Jan 20, 2021
by
Lukas Brocke
Browse files
dnsapi/ionos: Fixes for Solaris
parent
d21e6235
Changes
1
Show whitespace changes
Inline
Side-by-side
dnsapi/dns_ionos.sh
View file @
a9d88301
...
@@ -104,9 +104,9 @@ _get_root() {
...
@@ -104,9 +104,9 @@ _get_root() {
return
1
return
1
fi
fi
_zone
=
"
$(
echo
"
$response
"
| _egrep_o
"
\"
name
\"
:
\"
$h
\"
.*
?
}"
)
"
_zone
=
"
$(
echo
"
$response
"
| _egrep_o
"
\"
name
\"
:
\"
$h
\"
.*
\
}
"
)
"
if
[
"
$_zone
"
]
;
then
if
[
"
$_zone
"
]
;
then
_zone_id
=
$(
printf
"%s
\n
"
"
$_zone
"
| _egrep_o
"
\"
id
\"
:
\"
[a-fA-F0-9-]
+
\"
"
| _head_n 1 |
cut
-d
:
-f
2 |
tr
-d
'\"'
)
_zone_id
=
$(
printf
"%s
\n
"
"
$_zone
"
| _egrep_o
"
\"
id
\"
:
\"
[a-fA-F0-9
\
-
]
*
\"
"
| _head_n 1 |
cut
-d
:
-f
2 |
tr
-d
'\"'
)
if
[
"
$_zone_id
"
]
;
then
if
[
"
$_zone_id
"
]
;
then
_sub_domain
=
$(
printf
"%s"
"
$domain
"
|
cut
-d
.
-f
1-
$p
)
_sub_domain
=
$(
printf
"%s"
"
$domain
"
|
cut
-d
.
-f
1-
$p
)
_domain
=
$h
_domain
=
$h
...
@@ -132,7 +132,7 @@ _ionos_get_existing_records() {
...
@@ -132,7 +132,7 @@ _ionos_get_existing_records() {
if
_ionos_rest GET
"
$IONOS_ROUTE_ZONES
/
$zone_id
?recordName=
$fulldomain
&recordType=TXT"
;
then
if
_ionos_rest GET
"
$IONOS_ROUTE_ZONES
/
$zone_id
?recordName=
$fulldomain
&recordType=TXT"
;
then
response
=
"
$(
echo
"
$response
"
|
tr
-d
"
\n
"
)
"
response
=
"
$(
echo
"
$response
"
|
tr
-d
"
\n
"
)
"
_existing_records
=
"
$(
printf
"%s
\n
"
"
$response
"
| _egrep_o
"
\"
records
\"
:
\[
.*
?
\]
"
| _head_n 1 |
cut
-d
'['
-f
2 |
sed
's/]//'
)
"
_existing_records
=
"
$(
printf
"%s
\n
"
"
$response
"
| _egrep_o
"
\"
records
\"
:
\[
.*
\]
"
| _head_n 1 |
cut
-d
'['
-f
2 |
sed
's/]//'
)
"
fi
fi
}
}
...
@@ -144,9 +144,9 @@ _ionos_get_record() {
...
@@ -144,9 +144,9 @@ _ionos_get_record() {
if
_ionos_rest GET
"
$IONOS_ROUTE_ZONES
/
$zone_id
?recordName=
$fulldomain
&recordType=TXT"
;
then
if
_ionos_rest GET
"
$IONOS_ROUTE_ZONES
/
$zone_id
?recordName=
$fulldomain
&recordType=TXT"
;
then
response
=
"
$(
echo
"
$response
"
|
tr
-d
"
\n
"
)
"
response
=
"
$(
echo
"
$response
"
|
tr
-d
"
\n
"
)
"
_record
=
"
$(
echo
"
$response
"
| _egrep_o
"
\
{\
"
name
\"
:
\"
$fulldomain
\"
[^
\}
]*
?
\"
type
\"
:
\"
TXT
\"
[^
\}
]*
?
\"
content
\"
:
\"\\\\\"
$txtrecord
\\\\\"\"
.*
?
\}
"
)
"
_record
=
"
$(
echo
"
$response
"
| _egrep_o
"
\"
name
\"
:
\"
$fulldomain
\"
[^
\}
]*
\"
type
\"
:
\"
TXT
\"
[^
\}
]*
\"
content
\"
:
\"\\\\\"
$txtrecord
\\\\\"\"
.*
\}
"
)
"
if
[
"
$_record
"
]
;
then
if
[
"
$_record
"
]
;
then
_record_id
=
$(
printf
"%s
\n
"
"
$_record
"
| _egrep_o
"
\"
id
\"
:
\"
[a-fA-F0-9-]
+
\"
"
| _head_n 1 |
cut
-d
:
-f
2 |
tr
-d
'\"'
)
_record_id
=
$(
printf
"%s
\n
"
"
$_record
"
| _egrep_o
"
\"
id
\"
:
\"
[a-fA-F0-9
\
-
]
*
\"
"
| _head_n 1 |
cut
-d
:
-f
2 |
tr
-d
'\"'
)
return
0
return
0
fi
fi
...
...
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