From 4cdef1e0b4913c89c699caa67f49ad29709f994b Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 30 Jul 2017 16:15:17 +0100 Subject: [PATCH] Remove keyserver key --- src/freedombone-app-keyserver | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/src/freedombone-app-keyserver b/src/freedombone-app-keyserver index 96f0743c..5b7f001e 100755 --- a/src/freedombone-app-keyserver +++ b/src/freedombone-app-keyserver @@ -437,6 +437,25 @@ function keyserver_edit { systemctl restart sks } +function keyserver_remove_key { + data=$(tempfile 2>/dev/null) + trap "rm -f $data" 0 1 2 5 15 + dialog --title $"Remove a key" \ + --backtitle $"Freedombone Control Panel" \ + --inputbox $"Enter the ID of the key which you wish to remove:" 12 60 2>$data + sel=$? + case $sel in + 0) + remove_key_id=$(<$data) + if [ ${#remove_key_id} -gt 8 ]; then + sks drop $remove_key_id + dialog --title $"Remove a key" \ + --msgbox $"The key was removed" 6 40 + fi + ;; + esac +} + function configure_interactive_keyserver { while true do @@ -444,19 +463,21 @@ function configure_interactive_keyserver { trap "rm -f $data" 0 1 2 5 15 dialog --backtitle $"Freedombone Control Panel" \ --title $"SKS Keyserver" \ - --radiolist $"Choose an operation:" 11 70 3 \ - 1 $"Sync with other keyserver" off \ - 2 $"Edit sync keyservers" off \ - 3 $"Exit" on 2> $data + --radiolist $"Choose an operation:" 12 70 4 \ + 1 $"Remove a key" off \ + 2 $"Sync with other keyserver" off \ + 3 $"Edit sync keyservers" off \ + 4 $"Exit" on 2> $data sel=$? case $sel in 1) return;; 255) return;; esac case $(cat $data) in - 1) keyserver_sync;; - 2) keyserver_edit;; - 3) break;; + 1) keyserver_remove_key;; + 2) keyserver_sync;; + 3) keyserver_edit;; + 4) break;; esac done }