summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/kvmd-certbot10
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'