From b165eece8b85b2532d53fed27fb6ca2573a79e70 Mon Sep 17 00:00:00 2001 From: kaotisk Date: Tue, 23 Jul 2024 18:27:15 +0300 Subject: ak-gpg: new --delete-secret-key flag --- lib/_ak_gpg | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'lib') diff --git a/lib/_ak_gpg b/lib/_ak_gpg index a214965..e83b87d 100755 --- a/lib/_ak_gpg +++ b/lib/_ak_gpg @@ -2,6 +2,7 @@ source $AK_LIBDIR/_ak_log source $AK_LIBDIR/_ak_ipfs source $AK_LIBDIR/_ak_config +source $AK_LIBDIR/_ak_settings _ak_gpg(){ gpg2 --homedir $AK_GPGHOME $* @@ -235,3 +236,26 @@ _ak_gpg_delete_key(){ fi done } + +_ak_gpg_delete_secret_key(){ + if [ ! -z $1 ] + then + x="$1" + if [ -n "$x" ] + then + _ak_log_info "$x was selected" + _ak_gpg --delete-secret-keys $x + if [ $? -ne 0 ] + then + _ak_log_error "Some error occured while removing $x" + exit 1 + else + _ak_log_info "Key $x was deleted" + fi + exit + else + _ak_log_warning "You didn't select a key" + exit 1 + fi + fi +} -- cgit v1.2.3