Files
dokku/plugins/ssh-keys/user-auth
2016-07-05 17:18:05 -07:00

14 lines
425 B
Bash
Executable File

#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
check_ssh_keys_user() {
declare desc="check user running ssh-keys"
local SSH_USER=$1 SSH_NAME=$2
[[ "$SSH_USER" == "root" || "$SSH_NAME" == *admin* ]] || dokku_log_fail "You must be root, or a dokku admin, to execute this command"
}
if [[ "$3" == ssh-keys* ]]; then
check_ssh_keys_user "$@"
fi