dns_dynu: Fix egrep regexp

Tested with busybox 1.28.3 in OpenWrt:

    # echo '{abc}' | egrep -o "{[^{]*}"
    egrep: bad regex '{[^{]*}': Repetition not preceded by valid expression
    # echo '{abc}' | egrep -o "\{[^{]*\}"
    {abc}
This commit is contained in:
Zhong Jianxin 2018-04-11 15:40:12 +08:00
parent d0d10bc6e7
commit ebdddf9fa7

View File

@ -161,7 +161,7 @@ _get_recordid() {
return 0 return 0
fi fi
_dns_record_id=$(printf "%s" "$response" | _egrep_o "{[^}]*}" | grep "\"text_data\":\"$txtvalue\"" | _egrep_o ",[^,]*," | grep ',"id":' | tr -d ",," | cut -d : -f 2) _dns_record_id=$(printf "%s" "$response" | _egrep_o "\{[^}]*\}" | grep "\"text_data\":\"$txtvalue\"" | _egrep_o ",[^,]*," | grep ',"id":' | tr -d ",," | cut -d : -f 2)
return 0 return 0
} }