summaryrefslogtreecommitdiff
path: root/rotate-keys.in
diff options
context:
space:
mode:
Diffstat (limited to 'rotate-keys.in')
-rw-r--r--rotate-keys.in16
1 files changed, 12 insertions, 4 deletions
diff --git a/rotate-keys.in b/rotate-keys.in
index ea50400..8c51e62 100644
--- a/rotate-keys.in
+++ b/rotate-keys.in
@@ -104,10 +104,18 @@ printf '%s\n' "${hosts}" \
-keyout "${key_dir}/${host}.key.new" \
-out "${tmp_dir}/${host}.csr" \
- printf 'https://%s/.csr/%s/%s.csr\n' \
- "${host}" \
- "${tmp_dir##*/}" \
- "${host}" \
+ {
+ printf 'http'
+ if [ -f "${key_dir}/${host}.key" ] \
+ && [ -f "${key_dir}/${host}.crt" ] \
+ && [ -f "${key_dir}/${host}.chain" ]; then
+ printf 's'
+ fi
+ printf '://%s/.csr/%s/%s.csr\n' \
+ "${host}" \
+ "${tmp_dir##*/}" \
+ "${host}"
+ } \
>> "${tmp_dir}/commands"
done