From 94df40075e1e19739b5ecf8ea3474e9c1b0c0e04 Mon Sep 17 00:00:00 2001 From: Brian Bennett Date: Wed, 13 May 2020 13:28:31 -0700 Subject: [PATCH] triton-dehydrated#40 Sometimes challenge value can start with - which severely confuses grep --- cns-hook-util | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cns-hook-util b/cns-hook-util index 9752169..3a828c2 100755 --- a/cns-hook-util +++ b/cns-hook-util @@ -49,8 +49,7 @@ function waitfortxt { read -r -a values <<< "$txtval" for val in "${values[@]}"; do while [ $count -lt 3 ]; do - dig +short txt "_acme-challenge.${domain}" @${NAMESERVER:-8.8.8.8} - if dig +short txt "_acme-challenge.${domain}" @${NAMESERVER:-8.8.8.8} | grep -w "$val" >/dev/null; then + if dig +short txt "_acme-challenge.${domain}" @${NAMESERVER:-8.8.8.8} | fgrep -- "$val" >/dev/null; then count=$(($count + 1)) else count=0