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
1f25b4a8
Commit
1f25b4a8
authored
Aug 24, 2018
by
Herman Sletteng
Browse files
Replacing "grep -o -P" with "_egrep_o" and sed
parent
1756bbff
Changes
1
Show whitespace changes
Inline
Side-by-side
dnsapi/dns_gdnsdk.sh
View file @
1f25b4a8
...
...
@@ -137,7 +137,7 @@ _mypost() {
_get_domain
()
{
_myget
'action=dns_primarydns'
_domains
=
$(
echo
"
$_result
"
|
grep
-o
-P
' domain="
\K(
[[:alnum:].-_]+
)
'
)
_domains
=
$(
echo
"
$_result
"
|
_e
grep
_o
' domain="[[:alnum:].-_]+
'
|
sed
's/^.*"//
'
)
if
[
-z
"
$_domains
"
]
;
then
_err
"Primary domain list not found!"
return
1
...
...
@@ -159,7 +159,7 @@ _successful_update() {
_findentry
()
{
#returns id of dns entry, if it exists
_myget
"action=dns_primary_changeDNSsetup&user_domain=
$_domain
"
_id
=
$(
echo
"
$_result
"
|
grep
-o
-P
"
$1
</td>
\s
*<td>
$2
.*?id=
\K
(
\d
*)"
)
_id
=
$(
echo
"
$_result
"
|
_e
grep
_o
"<td>
$1
</td>
\s
*<td>
$2
</td>[^?]*[^&]*&id=[^&]*"
|
sed
's/^.*=//'
)
if
[
-n
"
$_id
"
]
;
then
_debug
"Entry found with _id=
$_id
"
return
0
...
...
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