Browse Source

Improve Cloud Key pre-flight error messaging

pull/3327/head
medmunds 5 years ago
parent
commit
17c2c735f5
  1. 12
      deploy/unifi.sh

12
deploy/unifi.sh

@ -86,11 +86,17 @@ unifi_deploy() {
_debug _cloudkey_certdir "$_cloudkey_certdir" _debug _cloudkey_certdir "$_cloudkey_certdir"
if [ "$_cloudkey_deploy" = "yes" ]; then if [ "$_cloudkey_deploy" = "yes" ]; then
if [ ! -d "$_cloudkey_certdir" ]; 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 fi
if [ ! -w "$_cloudkey_certdir" ]; then 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 return 1
fi fi
fi fi

Loading…
Cancel
Save