From 6fe409aaf34fb689d7f72e5040e5a8ec47ef4215 Mon Sep 17 00:00:00 2001 From: Alexander Paetzelt Date: Tue, 7 Jul 2020 11:16:18 +0200 Subject: [PATCH] Still need the exported pubkey file --- initrd/bin/oem-factory-reset | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/initrd/bin/oem-factory-reset b/initrd/bin/oem-factory-reset index 2840aabe..0f873e25 100755 --- a/initrd/bin/oem-factory-reset +++ b/initrd/bin/oem-factory-reset @@ -397,14 +397,15 @@ if [ "$CUSTOM_PASS" != "" ]; then ADMIN_PIN_DEF=$CUSTOM_PASS fi -## export generated key to USB +# export pubkey to file +if ! gpg --export --armor $GPG_GEN_KEY > "${PUBKEY}" 2>/tmp/error ; then + ERROR=$(tail -n 1 /tmp/error) + whiptail_error_die "GPG Key gpg export to file failed!\n\n$ERROR" +fi + +## export pubkey to USB if [ $GPG_EXPORT -ne 0 ]; then echo -e "\nExporting generated key to USB...\n" - # export pubkey to file - if ! gpg --export --armor $GPG_GEN_KEY > "${PUBKEY}" 2>/tmp/error ; then - ERROR=$(tail -n 1 /tmp/error) - whiptail_error_die "GPG Key gpg export to file failed!\n\n$ERROR" - fi # copy to USB if ! cp "${PUBKEY}" "/media/${GPG_GEN_KEY}.asc" 2>/tmp/error ; then ERROR=$(tail -n 1 /tmp/error)