summaryrefslogtreecommitdiffstats
path: root/dehydrated/share/hooks/deploy_cert.extra
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2022-07-07 10:02:08 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2022-07-07 14:14:21 +0000
commitfab9b7a030eb1b638e40f59515da5fd771fcb0b1 (patch)
tree13abf76c0492c9af85d4773a1fed56c3c9928898 /dehydrated/share/hooks/deploy_cert.extra
parentReleasing version 20220704. (diff)
downloadservice-tools-fab9b7a030eb1b638e40f59515da5fd771fcb0b1.tar.xz
service-tools-fab9b7a030eb1b638e40f59515da5fd771fcb0b1.zip
Merging the different extra certificate files into one dehydrated hook handling all extra copies.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to '')
-rwxr-xr-xdehydrated/share/hooks/deploy_cert.extra (renamed from dehydrated/share/hooks/deploy_cert.fullchain-privkey)17
1 files changed, 13 insertions, 4 deletions
diff --git a/dehydrated/share/hooks/deploy_cert.fullchain-privkey b/dehydrated/share/hooks/deploy_cert.extra
index 57d735b..ec61676 100755
--- a/dehydrated/share/hooks/deploy_cert.fullchain-privkey
+++ b/dehydrated/share/hooks/deploy_cert.extra
@@ -21,8 +21,17 @@
set -e
-DIRECTORY="$(dirname "${FULLCHAINFILE}")"
-FILE="cert.fullchain-privkey-${TIMESTAMP}.pem"
+echo " + Creating extra certificate files..."
-cat "${FULLCHAINFILE}" "${KEYFILE}" > "${DIRECTORY}/${FILE}"
-ln -sf "${FILE}" "${DIRECTORY}/cert.fullchain-privkey.pem"
+DIRECTORY="$(dirname "${CERTFILE}")"
+
+for EXTRA in fullchain-privkey privkey-fullchain
+do
+ EXTRA1="$(echo ${EXTRA} | awk -F- '{ print $1 }')"
+ EXTRA2="$(echo ${EXTRA} | awk -F- '{ print $2 }')"
+
+ cat "${EXTRA1}-${TIMESTAMP}.pem" "${EXTRA2}-${TIMESTAMP}.pem" > "${DIRECTORY}/${EXTRA1}-${EXTRA2}-${TIMESTAMP}.pem"
+ ln -sf "${EXTRA1}-${EXTRA2}-${TIMESTAMP}.pem" "${DIRECTORY}/cert.${EXTRA1}-${EXTRA2}.pem"
+done
+
+echo " done."