summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-08-26 15:09:39 +0200
committerErich Eckner <git@eckner.net>2019-08-26 15:09:39 +0200
commit8e493931c07909ed07fe3e8b6ffc61a7cab01ba1 (patch)
treef85609d5cebcdac99d4f9c517ebe027b266dc2e9
parent868fd84307c764519bbc2e7eef9ec529db45977b (diff)
downloadsimple-pki-8e493931c07909ed07fe3e8b6ffc61a7cab01ba1.tar.xz
generate-and-upload-self-signed-keys.in: fix typos
-rwxr-xr-xgenerate-and-upload-self-signed-keys.in18
1 files changed, 9 insertions, 9 deletions
diff --git a/generate-and-upload-self-signed-keys.in b/generate-and-upload-self-signed-keys.in
index 2935462..20423b3 100755
--- a/generate-and-upload-self-signed-keys.in
+++ b/generate-and-upload-self-signed-keys.in
@@ -44,10 +44,10 @@ host_key_files=$(
if [ "$(whoami)" = 'root' ]; then
updated_something=false
for host_key_file in ${host_key_files}; do
- if [ -f "${keydir}/${host_key_file}.key.pem.new" ] \
- && [ -f "${keydir}/${host_key_file}.cert.pem.new" ]; then
- mv "${keydir}/${host_key_file}.key.pem"{.new,}
- mv "${keydir}/${host_key_file}.cert.pem"{.new,}
+ if [ -f "${key_dir}/${host_key_file}.key.pem.new" ] \
+ && [ -f "${key_dir}/${host_key_file}.cert.pem.new" ]; then
+ mv "${key_dir}/${host_key_file}.key.pem"{.new,}
+ mv "${key_dir}/${host_key_file}.cert.pem"{.new,}
updated_something=true
fi
done
@@ -65,8 +65,8 @@ fi
printf '%s\n' "${hosts}" \
| while read -r host other_hosts; do
openssl req -x509 -newkey rsa:4096 \
- -keyout "${keydir}/${host}.key.pem.new" \
- -out "${keydir}/${host}.cert.pem.new" \
+ -keyout "${key_dir}/${host}.key.pem.new" \
+ -out "${key_dir}/${host}.cert.pem.new" \
-days 365 -nodes -subj '/C=DE/ST=Thuringia/L=Jena/O=Eckner/OU=Net/CN='"${host}" -sha256 \
-config <(
cat '#ETCDIR#/ssl/openssl.cnf'
@@ -82,13 +82,13 @@ done
rsync --ignore-missing-args \
$(
- printf -- "${keydir}"'/%s.cert.pem\n' ${host_key_files}
- printf -- "${keydir}"'/%s.cert.pem.new\n' ${host_key_files}
+ printf -- "${key_dir}"'/%s.cert.pem\n' ${host_key_files}
+ printf -- "${key_dir}"'/%s.cert.pem.new\n' ${host_key_files}
) \
"${remote_host}:${remote_dir}/"
(
- cd "${keydir}"
+ cd "${key_dir}"
{
printf '%s.cert.pem\n' ${host_key_files}
printf '%s.cert.pem.new\n' ${host_key_files}