aboutsummaryrefslogtreecommitdiff
path: root/lib/_ak_gpg
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2024-07-23 18:27:15 +0300
committerkaotisk <kaotisk@arching-kaos.org>2024-07-23 18:27:15 +0300
commitb165eece8b85b2532d53fed27fb6ca2573a79e70 (patch)
treefa3c7d92d88ccf81ee6f437a5e3ec8d29ef63233 /lib/_ak_gpg
parent47f8aaf1a7ef90ba597e681792e95b667a7da111 (diff)
downloadarching-kaos-tools-b165eece8b85b2532d53fed27fb6ca2573a79e70.tar.gz
arching-kaos-tools-b165eece8b85b2532d53fed27fb6ca2573a79e70.tar.bz2
arching-kaos-tools-b165eece8b85b2532d53fed27fb6ca2573a79e70.zip
ak-gpg: new --delete-secret-key flag
Diffstat (limited to 'lib/_ak_gpg')
-rwxr-xr-xlib/_ak_gpg24
1 files changed, 24 insertions, 0 deletions
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
+}