Skip to content

Commit

Permalink
improve id parse
Browse files Browse the repository at this point in the history
Locate only the outer most "id" property
  • Loading branch information
Blfrg committed Feb 9, 2020
1 parent 8189a34 commit eb49127
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dnsapi/dns_me.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ _get_root() {
fi

if _contains "$response" "\"name\":\"$h\""; then
_domain_id=$(printf "%s\n" "$response" | _egrep_o "\"id\":[0-9]+}$" | head -n 1 | cut -d : -f 2 | tr -d '}')
_domain_id=$(printf "%s\n" "$response" | cut -c 2- | head -c -2 | sed 's/{.*}//' | sed -r 's/^.*"id":([0-9]+).*$/\1/')
if [ "$_domain_id" ]; then
_sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
_domain="$h"
Expand Down

1 comment on commit eb49127

@Wasca
Copy link

@Wasca Wasca commented on eb49127 Feb 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Blfrg I needed to change line 117 back to the following for certificates to be able to renew.

_domain_id=$(printf "%s\n" "$response" | _egrep_o "\"id\":[^,]*" | head -n 1 | cut -d : -f 2 | tr -d '}')

I'm using this script on Pfsense 2.4.4-p3 with the acme package version 0.6.5

Screen Shot 2020-02-26 at 10 32 57 am

Please sign in to comment.