fix: do not unset variables unless re-running as dokku user

This commit is contained in:
Jose Diaz-Gonzalez
2024-03-14 08:14:36 -04:00
parent 83b89453a5
commit 89cff8957f
2 changed files with 1 additions and 1 deletions

2
dokku
View File

@@ -88,8 +88,8 @@ fi
! has_tty && DOKKU_QUIET_OUTPUT=1
if [[ $(id -un) != "dokku" ]]; then
unset DOKKU_PID TMP TMPDIR TEMP TEMPDIR
if [[ ! $1 =~ plugin:* ]] && [[ $1 != "ssh-keys:add" ]] && [[ $1 != "ssh-keys:remove" ]] && [[ $1 != "scheduler-k3s:initialize" ]] && [[ $1 != "scheduler-k3s:uninstall" ]]; then
unset DOKKU_PID TMP TMPDIR TEMP TEMPDIR
export SSH_USER=$(id -un)
sudo -u dokku -E -H "$0" "$@"
exit $?

Binary file not shown.