From 17c2c735f575063d2e6b3af1a51670b4de599eea Mon Sep 17 00:00:00 2001 From: medmunds Date: Tue, 29 Dec 2020 09:32:42 -0800 Subject: [PATCH] Improve Cloud Key pre-flight error messaging --- deploy/unifi.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/deploy/unifi.sh b/deploy/unifi.sh index a36f4cb1..b17e1449 100644 --- a/deploy/unifi.sh +++ b/deploy/unifi.sh @@ -86,11 +86,17 @@ unifi_deploy() { _debug _cloudkey_certdir "$_cloudkey_certdir" if [ "$_cloudkey_deploy" = "yes" ]; then if [ ! -d "$_cloudkey_certdir" ]; then - _err "The directory $_cloudkey_certdir is missing or invalid; please define DEPLOY_UNIFI_CLOUDKEY_CERTDIR" - return 1 + if [ -z "$DEPLOY_UNIFI_CLOUDKEY_CERTDIR"]; then + _err "Attempting to deploy on a Cloud Key, but cert dir not found in usual location." + _err "Either set DEPLOY_UNIFI_CLOUDKEY=no or define DEPLOY_UNIFI_CLOUDKEY_CERTDIR." + return 1 + else + _err "The Cloud Key cert dir $_cloudkey_certdir is not valid, please check." + return 1 + fi fi if [ ! -w "$_cloudkey_certdir" ]; then - _err "The directory $_cloudkey_certdir is not writable; please check permissions" + _err "The directory $_cloudkey_certdir is not writable; please check permissions." return 1 fi fi