Add gpg email address or key ID
Sometimes on a profile people only give their key ID
This commit is contained in:
parent
db6986fdd9
commit
e6583a18a3
|
@ -375,19 +375,30 @@ function add_gpg_key {
|
||||||
trap "rm -f $data" 0 1 2 5 15
|
trap "rm -f $data" 0 1 2 5 15
|
||||||
dialog --title $"Add someone's PGP/GPG key" \
|
dialog --title $"Add someone's PGP/GPG key" \
|
||||||
--backtitle $"Freedombone User Control Panel" \
|
--backtitle $"Freedombone User Control Panel" \
|
||||||
--inputbox $"Enter their email address below" 8 60 2>$data
|
--inputbox $"Enter their email address or Key ID below" 8 60 2>$data
|
||||||
sel=$?
|
sel=$?
|
||||||
case $sel in
|
case $sel in
|
||||||
0)
|
0)
|
||||||
ADD_EMAIL_ADDRESS=$(<$data)
|
ADD_EMAIL_ADDRESS=$(<$data)
|
||||||
if [ ${#ADD_EMAIL_ADDRESS} -gt 2 ]; then
|
if [ ${#ADD_EMAIL_ADDRESS} -gt 2 ]; then
|
||||||
|
|
||||||
|
address_is_valid=
|
||||||
|
|
||||||
if [[ $ADD_EMAIL_ADDRESS == *"@"* && $ADD_EMAIL_ADDRESS == *"."* ]]; then
|
if [[ $ADD_EMAIL_ADDRESS == *"@"* && $ADD_EMAIL_ADDRESS == *"."* ]]; then
|
||||||
|
address_is_valid=1
|
||||||
|
else
|
||||||
|
if [[ $ADD_EMAIL_ADDRESS == "0x"* ]]; then
|
||||||
|
address_is_valid=1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $address_is_valid ]; then
|
||||||
clear
|
clear
|
||||||
gpg --search-keys $ADD_EMAIL_ADDRESS
|
gpg --search-keys $ADD_EMAIL_ADDRESS
|
||||||
else
|
else
|
||||||
dialog --title $"Unrecognised email address" \
|
dialog --title $"Unrecognised email address" \
|
||||||
--backtitle $"Freedombone User Control Panel" \
|
--backtitle $"Freedombone User Control Panel" \
|
||||||
--msgbox $"This doesn't look like an email address" 6 50
|
--msgbox $"This doesn't look like an email address or key ID" 6 50
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in New Issue