From 409c9b84d95f28a2023b69f3ff8c6e1fc155cd07 Mon Sep 17 00:00:00 2001 From: erkin Date: Tue, 8 Mar 2022 13:41:20 +0300 Subject: loadkey: T3506: Remove loadkey --- etc/bash_completion.d/vyatta-cfg | 44 +++++----------------------------------- 1 file changed, 5 insertions(+), 39 deletions(-) diff --git a/etc/bash_completion.d/vyatta-cfg b/etc/bash_completion.d/vyatta-cfg index 0226ed9..5b02d00 100644 --- a/etc/bash_completion.d/vyatta-cfg +++ b/etc/bash_completion.d/vyatta-cfg @@ -232,49 +232,15 @@ vyatta_loadsave_complete() vyatta_config_loadkey() { - # don't load if there are uncommitted changes. - if vyatta_cli_shell_api sessionChanged; then - echo "Cannot load: configuration modified." - echo "Commit or discard the changes before loading a config file." - return 1 - fi - # return to top level. - reset_edit_level - ${vyatta_sbindir}/vyatta-load-user-key.pl "$@" + echo "Warning: The obsolete 'loadkey' command has been phased out." + echo "Instead, use the op-mode command 'generate public-key-command' to generate commands for manual addition:" + echo '$ generate public-key-command name path ' + echo } vyatta_loadkey_complete() { - - local restore_shopts=$( shopt -p extglob nullglob | tr \\n \; ) - shopt -s extglob nullglob - - if [[ $COMP_CWORD -eq 0 ]];then - vyatta_config_complete "$@" - eval $restore_shopts - return - fi - - case "$COMP_CWORD" in - 1) if [ -z "${COMP_WORDS[1]}" ]; then - COMPREPLY=( $(getent passwd | awk -F: '$7 == "/bin/vbash" { print $1}') ) - else - COMPREPLY=( $(compgen -u -- ${COMP_WORDS[1]} ) ) - fi ;; - 2) if [ -z "${COMP_WORDS[2]}" ]; then - echo - echo "Possible completions:" - echo -e " \t\t\t\tLoad from file on local machine" - echo -e " scp://@:/\tLoad from file on remote machine" - echo -e " sftp://@/\tLoad from file on remote machine" - echo -e " ftp://@/\tLoad from file on remote machine" - echo -e " http:///\t\t\tLoad from file on remote machine" - echo -e " tftp:///\t\t\tLoad from file on remote machine" - COMPREPLY=( "" " " ) - else - COMPREPLY=( $(compgen -f -- ${COMP_WORDS[2]} ) ) - fi ;; - esac + true } print_commit_log () -- cgit v1.2.3