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
70702e41
Commit
70702e41
authored
Dec 06, 2017
by
Aarup
Browse files
Use _head_n
parent
0ca31410
Changes
1
Hide whitespace changes
Inline
Side-by-side
dnsapi/dns_unoeuro.sh
View file @
70702e41
...
@@ -65,7 +65,7 @@ dns_unoeuro_add() {
...
@@ -65,7 +65,7 @@ dns_unoeuro_add() {
_err
"Add txt record error."
_err
"Add txt record error."
else
else
_info
"Updating record"
_info
"Updating record"
record_id
=
$(
echo
"
$response
"
|
grep
-B
1
"
$_sub_domain
"
|
head
-1
| _egrep_o
"[0-9]{1,}"
)
record_id
=
$(
echo
"
$response
"
|
grep
-B
1
"
$_sub_domain
"
|
_
head
_n
-1
| _egrep_o
"[0-9]{1,}"
)
_debug
"record_id"
"
$record_id
"
_debug
"record_id"
"
$record_id
"
_uno_rest PUT
"my/products/
$h
/dns/records/
$record_id
"
"{
\"
name
\"
:
\"
$fulldomain
\"
,
\"
type
\"
:
\"
TXT
\"
,
\"
data
\"
:
\"
$txtvalue
\"
,
\"
ttl
\"
:120}"
_uno_rest PUT
"my/products/
$h
/dns/records/
$record_id
"
"{
\"
name
\"
:
\"
$fulldomain
\"
,
\"
type
\"
:
\"
TXT
\"
,
\"
data
\"
:
\"
$txtvalue
\"
,
\"
ttl
\"
:120}"
...
@@ -114,7 +114,7 @@ dns_unoeuro_rm() {
...
@@ -114,7 +114,7 @@ dns_unoeuro_rm() {
if
!
_contains
"
$response
"
"
$_sub_domain
"
>
/dev/null
;
then
if
!
_contains
"
$response
"
"
$_sub_domain
"
>
/dev/null
;
then
_info
"Don't need to remove."
_info
"Don't need to remove."
else
else
record_id
=
$(
echo
"
$response
"
|
grep
-B
1
"
$_sub_domain
"
|
head
-1
| _egrep_o
"[0-9]{1,}"
)
record_id
=
$(
echo
"
$response
"
|
grep
-B
1
"
$_sub_domain
"
|
_
head
_n
-1
| _egrep_o
"[0-9]{1,}"
)
_debug
"record_id"
"
$record_id
"
_debug
"record_id"
"
$record_id
"
if
[
-z
"
$record_id
"
]
;
then
if
[
-z
"
$record_id
"
]
;
then
...
...
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