Split out import process for root certs

master
Brie Bruns 2021-10-10 21:35:00 -06:00
parent cad3656236
commit 3f25ad6b21
1 changed files with 8 additions and 8 deletions

View File

@ -2,8 +2,8 @@
# Modified script from here: https://github.com/FarsetLabs/letsencrypt-helper-scripts/blob/master/letsencrypt-unifi.sh # Modified script from here: https://github.com/FarsetLabs/letsencrypt-helper-scripts/blob/master/letsencrypt-unifi.sh
# Modified by: Brielle Bruns <bruns@2mbit.com> # Modified by: Brielle Bruns <bruns@2mbit.com>
# Download URL: https://source.sosdg.org/brielle/lets-encrypt-scripts # Download URL: https://source.sosdg.org/brielle/lets-encrypt-scripts
# Version: 1.9 # Version: 1.92
# Last Changed: 09/22/2021 # Last Changed: 10/10/2021
# 02/02/2016: Fixed some errors with key export/import, removed lame docker requirements # 02/02/2016: Fixed some errors with key export/import, removed lame docker requirements
# 02/27/2016: More verbose progress report # 02/27/2016: More verbose progress report
# 03/08/2016: Add renew option, reformat code, command line options # 03/08/2016: Add renew option, reformat code, command line options
@ -206,15 +206,15 @@ _EOF
echo "Importing root LE CA cert and intermediaries..." echo "Importing root LE CA cert and intermediaries..."
keytool -import -trustcacerts -alias root -file "${CATEMPFILE}" \ keytool -import -trustcacerts -alias root -file "${CATEMPFILE}" \
-storepass aircontrolenterprise -keystore "${KEYSTORE}" -storepass aircontrolenterprise -keystore "${KEYSTORE}" -noprompt
keytool -import -trustcacerts -alias intermediate1 -file "${INTERMEDTEMPFILE}" \ keytool -import -trustcacerts -alias intermediate1 -file "${INTERMEDTEMPFILE}" \
-storepass aircontrolenterprise -keystore "${KEYSTORE}" -storepass aircontrolenterprise -keystore "${KEYSTORE}" -noprompt
echo "Removing existing certificate from Unifi protected keystore..." #echo "Removing existing certificate from Unifi protected keystore..."
keytool -delete -alias unifi -keystore /usr/lib/unifi/data/keystore \ #keytool -delete -alias unifi -keystore /usr/lib/unifi/data/keystore \
-deststorepass aircontrolenterprise # -deststorepass aircontrolenterprise
echo "Importing certificate into Unifi keystore..." echo "Importing certificate into Unifi keystore..."
keytool -importkeystore \ keytool -importkeystore \
@ -223,7 +223,7 @@ _EOF
-destkeystore /usr/lib/unifi/data/keystore \ -destkeystore /usr/lib/unifi/data/keystore \
-srckeystore "${TEMPFILE}" -srcstoretype PKCS12 \ -srckeystore "${TEMPFILE}" -srcstoretype PKCS12 \
-srcstorepass aircontrolenterprise \ -srcstorepass aircontrolenterprise \
-alias unifi -alias unifi -noprompt
rm -f "${TEMPFILE}" "${CATEMPFILE}" "${INTERMEDTEMPFILE}" rm -f "${TEMPFILE}" "${CATEMPFILE}" "${INTERMEDTEMPFILE}"
echo "Starting Unifi controller..." echo "Starting Unifi controller..."