mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-04-17 14:09:42 +02:00
use [ -z .. ] instead of explicit compare with ""
This commit is contained in:
@@ -55,7 +55,7 @@ sign_domain() {
|
|||||||
challenge_token="$(printf '%s\n' "${response}" | grep -Eo '"challenges":[^\[]*\[[^]]*]' | sed 's/{/\n{/g' | grep 'http-01' | grep -Eo '"token":\s*"[^"]*"' | cut -d'"' -f4 | sed 's/[^A-Za-z0-9_\-]/_/g')"
|
challenge_token="$(printf '%s\n' "${response}" | grep -Eo '"challenges":[^\[]*\[[^]]*]' | sed 's/{/\n{/g' | grep 'http-01' | grep -Eo '"token":\s*"[^"]*"' | cut -d'"' -f4 | sed 's/[^A-Za-z0-9_\-]/_/g')"
|
||||||
challenge_uri="$(printf '%s\n' "${response}" | grep -Eo '"challenges":[^\[]*\[[^]]*]' | sed 's/{/\n{/g' | grep 'http-01' | grep -Eo '"uri":\s*"[^"]*"' | cut -d'"' -f4)"
|
challenge_uri="$(printf '%s\n' "${response}" | grep -Eo '"challenges":[^\[]*\[[^]]*]' | sed 's/{/\n{/g' | grep 'http-01' | grep -Eo '"uri":\s*"[^"]*"' | cut -d'"' -f4)"
|
||||||
|
|
||||||
if [ "${challenge_token}" = "" ] || [ "${challenge_uri}" = "" ]; then
|
if [ -z "${challenge_token}" ] || [ -z "${challenge_uri}" ]; then
|
||||||
echo " + Error: Can't retrieve challenges (${response})"
|
echo " + Error: Can't retrieve challenges (${response})"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user