gpg_add_key_reflash: handle user cancellation

if user chooses abort option, exit without flashing ROM

Signed-off-by: Matt DeVillier <matt.devillier@puri.sm>
This commit is contained in:
Matt DeVillier 2019-07-09 16:53:40 -05:00
parent c33209add1
commit e8e1032027
No known key found for this signature in database
GPG Key ID: 2BBB776A35B978FD

View File

@ -196,7 +196,12 @@ gpg_add_key_reflash() {
find /media -name '*.key' > /tmp/filelist.txt
find /media -name '*.asc' >> /tmp/filelist.txt
file_selector "/tmp/filelist.txt" "Choose your GPG public key"
PUBKEY=$FILE
# bail if user didn't select a file
if [ "$FILE" = "" ]; then
return
else
PUBKEY=$FILE
fi
/bin/flash.sh -r /tmp/gpg-gui.rom
if [ ! -s /tmp/gpg-gui.rom ]; then