From f2a4f61920f2a99bdb5d9765e12bad6c9963ec40 Mon Sep 17 00:00:00 2001 From: Omar Shehata Date: Sat, 3 Dec 2016 19:36:11 +0000 Subject: [PATCH] Added ssh-keys plugin default to list --- plugins/ssh-keys/functions | 7 +++++++ plugins/ssh-keys/subcommands/default | 12 ++++++++++++ plugins/ssh-keys/subcommands/list | 7 ------- 3 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 plugins/ssh-keys/subcommands/default diff --git a/plugins/ssh-keys/functions b/plugins/ssh-keys/functions index 24b5e6807..767f4ae11 100755 --- a/plugins/ssh-keys/functions +++ b/plugins/ssh-keys/functions @@ -2,6 +2,13 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" +list_ssh_keys() { + declare desc="List ssh key hashes" + local cmd="ssh-keys:list" + verify_ssh_key_file + sshcommand list dokku +} + verify_ssh_key_file() { declare desc="Test that public key is valid" [[ -s ${DOKKU_ROOT}/.ssh/authorized_keys ]] || dokku_log_fail "No public keys found." diff --git a/plugins/ssh-keys/subcommands/default b/plugins/ssh-keys/subcommands/default new file mode 100644 index 000000000..abdbaa619 --- /dev/null +++ b/plugins/ssh-keys/subcommands/default @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x +source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" +source "$PLUGIN_AVAILABLE_PATH/ssh-keys/functions" + +ssh_keys_main_cmd() { + declare desc="an alias for ssh-keys:list" + local cmd="ssh-keys" + list_ssh_keys +} + +ssh_keys_main_cmd "$@" \ No newline at end of file diff --git a/plugins/ssh-keys/subcommands/list b/plugins/ssh-keys/subcommands/list index ce485bbd6..fb78c5e2a 100755 --- a/plugins/ssh-keys/subcommands/list +++ b/plugins/ssh-keys/subcommands/list @@ -3,11 +3,4 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/ssh-keys/functions" -list_ssh_keys() { - declare desc="List ssh key hashes" - local cmd="ssh-keys:list" - verify_ssh_key_file - sshcommand list dokku -} - list_ssh_keys "$@"