From 66115e532350840272293ead8d211f26af5c8c23 Mon Sep 17 00:00:00 2001 From: Solly Ross Date: Tue, 18 Mar 2014 15:12:05 -0400 Subject: [PATCH] Fix broken if statement in lib/tls on ZSH When using ZSH, the line `if [[ (!$cert && !$key && $ca) ]]` fails due to a syntax error. Instead of checking the variables as a boolean, we can simply check if they have a non-zero length. This works in ZSH. Change-Id: I171ed10a8c0af354e82bd6119508a0c44b6bcd9c --- lib/tls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tls b/lib/tls index 072059d599..88e5f60473 100644 --- a/lib/tls +++ b/lib/tls @@ -348,7 +348,7 @@ function ensure_certificates { local key=${!key_var} local ca=${!ca_var} - if [[ !($cert && $key && $ca) ]]; then + if [[ -z "$cert" || -z "$key" || -z "$ca" ]]; then die $LINENO "Missing either the ${cert_var} ${key_var} or ${ca_var}" \ "variable to enable SSL for ${service}" fi