From dfa2aa800ae0fcf8ebb92a6f61c597f86bda0f71 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Sun, 1 Sep 2019 22:21:34 +0200 Subject: rotate-keys.in: "cd /" to avoid permission problems --- rotate-keys.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3-70-g09d2