Fix ssh-keys:add permission error

This commit is contained in:
Justin Clark committed 2016-08-12 16:01:05 -07:00
1 parent 3651e56ca5
commit 98ec2979ea
2 files changed
+5 -5

No files matched your search

+3 -3
View File
@@ -56,14 +56,14 @@ if [[ "${args[0]}" =~ ^--.* ]]; then
fi
! has_tty && DOKKU_QUIET_OUTPUT=1
if [[ $(id -un) != "dokku" ]] && [[ ! $1 =~ plugin:* ]]; then
if [[ $(id -un) != "dokku" ]] && [[ ! $1 =~ plugin:* ]] && [[ ! $1 == "ssh-keys:add" ]]; then
export SSH_USER=$(id -un)
sudo -u dokku -E -H "$0" "$@"
exit $?
fi
if [[ $(id -un) != "root" && $1 =~ ^plugin:.* ]]; then
dokku_log_fail "plugin:* commands must be run as root"
if [[ $(id -un) != "root" && $1 =~ ^plugin:.* ]] || [[ $(id -un) != "root" && $1 == "ssh-keys:add" ]]; then
dokku_log_fail "This command must be run as root"
fi
if [[ -n "$SSH_ORIGINAL_COMMAND" ]]; then