Remove keyserver key

This commit is contained in:
Bob Mottram 2017-07-30 16:15:17 +01:00
parent 0607a26ea8
commit 4cdef1e0b4
1 changed files with 28 additions and 7 deletions

View File

@ -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
}