From e54ae11c333dac161310e5b9782c8f571f21ae35 Mon Sep 17 00:00:00 2001 From: Maxim Devaev Date: Sun, 26 Jun 2022 05:22:34 +0300 Subject: restore permissions --- scripts/kvmd-certbot | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'scripts') 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" \ -- cgit v1.2.3