]> git.ipfire.org Git - thirdparty/dehydrated.git/commitdiff
use [ -z .. ] instead of explicit compare with ""
authorSimon Ruderich <simon@ruderich.org>
Sat, 5 Dec 2015 13:25:11 +0000 (14:25 +0100)
committerSimon Ruderich <simon@ruderich.org>
Sat, 5 Dec 2015 15:38:19 +0000 (16:38 +0100)
letsencrypt.sh

index eb72b3de03fb37b86f0359a258ec8d58d9cc636c..361ab300cf1e1e1c75119abb06358f6d7a58de27 100755 (executable)
@@ -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_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})"
       exit 1
     fi