diff options
-rwxr-xr-x | scripts/kvmd-certbot | 13 |
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" \ |