summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2022-06-26 05:22:34 +0300
committerMaxim Devaev <[email protected]>2022-06-26 05:22:34 +0300
commite54ae11c333dac161310e5b9782c8f571f21ae35 (patch)
treed13218d9c7741151e6be6c3455aade5523063340
parent6f4d45440ac203829373718e98fa33e23fa96d13 (diff)
restore permissions
-rwxr-xr-xscripts/kvmd-certbot13
1 files changed, 6 insertions, 7 deletions
diff --git a/scripts/kvmd-certbot b/scripts/kvmd-certbot
index 0c109ff5..8cdc1f10 100755
--- a/scripts/kvmd-certbot
+++ b/scripts/kvmd-certbot
@@ -49,13 +49,11 @@ function create_tmp() {
}
function ensure_runroot() {
- if [ ! -d "$cur" ]; then
- kvmd-pstrun -- bash -c "
- set -ex
- mkdir -p '$cur'
- chown '$user:' '$cur'
- "
- fi
+ kvmd-pstrun -- bash -c "
+ set -ex
+ mkdir -p '$cur'
+ chown -R '$user:' '$cur/..'
+ "
}
function restart_if_running() {
@@ -99,6 +97,7 @@ case "$1" in
shift
create_tmp
cp -a "$cur"/{config,work,logs} "$tmp"
+ chown -R "$user:" "$tmp"
sed -s -i -e "s| = $cur/| = $tmp/|g" "$tmp/config/renewal/"*
sudo -u "$user" certbot renew "$@" \
--config-dir="$tmp/config" \