]> git.proxmox.com Git - mirror_acme.sh.git/commitdiff
Replacing "grep -o -P" with "_egrep_o" and sed
authorHerman Sletteng <herman@sletteng.org>
Thu, 23 Aug 2018 22:18:04 +0000 (00:18 +0200)
committerHerman Sletteng <herman@sletteng.org>
Fri, 24 Aug 2018 11:27:16 +0000 (13:27 +0200)
dnsapi/dns_gdnsdk.sh

index 05a4c9fc7068f075b8fb1b5c2f08e97e42772e9b..7dc7894a6c2bb9ac9a58c703eafa180d1c13ce0d 100755 (executable)
@@ -137,7 +137,7 @@ _mypost() {
 
 _get_domain() {
   _myget 'action=dns_primarydns'
-  _domains=$(echo "$_result" | grep -o -P ' domain="\K([[:alnum:].-_]+)')
+  _domains=$(echo "$_result" | _egrep_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" | _egrep_o "<td>$1</td>\s*<td>$2</td>[^?]*[^&]*&id=[^&]*" | sed 's/^.*=//')
   if [ -n "$_id" ]; then
     _debug "Entry found with _id=$_id"
     return 0