diff options
author | Maxim Devaev <[email protected]> | 2022-07-03 17:26:15 +0300 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2022-07-03 17:26:15 +0300 |
commit | b816bcb3351102d239df7f2a163d687c66d7bc74 (patch) | |
tree | dcefa9abb8d5a48d0bfa4eb2ea838ffeb95ad0f1 /scripts | |
parent | 74785aec887e7ad496aa1244efa03d3cd67e6f45 (diff) |
sudo --preserve-env in kvmd-certbot
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/kvmd-certbot | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/kvmd-certbot b/scripts/kvmd-certbot index fa097e0f..2fdd0c1d 100755 --- a/scripts/kvmd-certbot +++ b/scripts/kvmd-certbot @@ -74,14 +74,14 @@ function restart_if_running_vnc() { case "$1" in -h|--help|help) create_tmp - sudo -u "$user" certbot "$@" "${cur_opts[@]}" + sudo --preserve-env -u "$user" certbot "$@" "${cur_opts[@]}" ;; --) shift create_tmp ensure_runroot - sudo -u "$user" kvmd-pstrun -- certbot "$@" "${cur_opts[@]}" + sudo --preserve-env -u "$user" kvmd-pstrun -- certbot "$@" "${cur_opts[@]}" ;; certonly|certonly_webroot) @@ -92,7 +92,7 @@ case "$1" in shift create_tmp ensure_runroot - sudo -u "$user" kvmd-pstrun -- certbot certonly "$@" "${cur_opts[@]}" \ + sudo --preserve-env -u "$user" kvmd-pstrun -- certbot certonly "$@" "${cur_opts[@]}" \ "${webroot_opts[@]}" \ --deploy-hook="/usr/bin/bash -c ' set -ex @@ -107,13 +107,13 @@ case "$1" in 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 "$@" \ + sudo --preserve-env -u "$user" certbot renew "$@" \ --config-dir="$tmp/config" \ --work-dir="$tmp/work" \ --logs-dir="$tmp/logs" \ --deploy-hook="/usr/bin/touch '$tmp/updated'" || true if [ -f "$tmp/updated" ]; then - sudo -u "$user" kvmd-pstrun -- bash -c " + sudo --preserve-env -u "$user" kvmd-pstrun -- bash -c " set -ex rm -rf '$new' cp -a '$tmp' '$new' |