From db911df59b2a2d31dc138476eaad7742c6a2d939 Mon Sep 17 00:00:00 2001 From: medmunds Date: Tue, 12 Jan 2021 11:08:59 -0800 Subject: [PATCH] Detect unsupported Cloud Key java keystore location --- deploy/unifi.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/deploy/unifi.sh b/deploy/unifi.sh index 3b7dac18..d7b8fe2a 100644 --- a/deploy/unifi.sh +++ b/deploy/unifi.sh @@ -119,6 +119,13 @@ unifi_deploy() { _err "The directory $_cloudkey_certdir is not writable; please check permissions." return 1 fi + # Cloud Key expects to load the keystore from /etc/ssl/private/unifi.keystore.jks. + # Normally /usr/lib/unifi/data/keystore is a symlink there (so the keystore was + # updated above), but if not, we don't know how to handle this installation: + if ! cmp -s "$_unifi_keystore" "${_cloudkey_certdir}/unifi.keystore.jks"; then + _err "Unsupported Cloud Key configuration: keystore not found at '${_cloudkey_certdir}/unifi.keystore.jks'" + return 1 + fi cp "$_cfullchain" "${_cloudkey_certdir}/cloudkey.crt" cp "$_ckey" "${_cloudkey_certdir}/cloudkey.key"