diff options
author | Erich Eckner <git@eckner.net> | 2019-09-01 22:21:34 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2019-09-01 22:21:34 +0200 |
commit | dfa2aa800ae0fcf8ebb92a6f61c597f86bda0f71 (patch) | |
tree | 9743940b69f448389ea083bf0addb3d44095a855 | |
parent | 097d3fe90f0e242ecebd1a9bf9b06d6397bf3789 (diff) | |
download | simple-pki-dfa2aa800ae0fcf8ebb92a6f61c597f86bda0f71.tar.xz |
rotate-keys.in: "cd /" to avoid permission problems
-rw-r--r-- | rotate-keys.in | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/rotate-keys.in b/rotate-keys.in index 724ea24..6116d9d 100644 --- a/rotate-keys.in +++ b/rotate-keys.in @@ -6,6 +6,9 @@ if [ -r '#ETCDIR#/simple-pki/cb.conf' ]; then . '#ETCDIR#/simple-pki/cb.conf' fi +me=$(readlink -e "$0") +cd / + hosts=$( find '#ETCDIR#/nginx/' \ -name keys -prune , \ @@ -61,7 +64,7 @@ if [ "$(whoami)" != "${certificate_user}" ]; then systemctl try-restart nginx fi - su "${certificate_user}" -s /bin/bash -c "$0" + su "${certificate_user}" -s /bin/bash -c "${me}" fi exit |