oem-factory-reset gui-init: fix whiptail_error segfaulting because selfcalling itself, fix typo in gui-init

fix bugs introduced by #1698

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
This commit is contained in:
Thierry Laurion 2024-09-04 14:26:42 -04:00
parent 3b22ae68e5
commit 3c76bdc510
No known key found for this signature in database
GPG Key ID: 9A53E1BB3FF00461
2 changed files with 4 additions and 4 deletions

View File

@ -363,7 +363,7 @@ check_gpg_key()
option=$(cat /tmp/whiptail)
case "$option" in
g )
gpg-gui.sh && BG_COLOR_MAIN_MENU="normnal"
gpg-gui.sh && BG_COLOR_MAIN_MENU="normal"
;;
i )
skip_to_menu="true"

View File

@ -62,7 +62,7 @@ die() {
exit 1
}
whiptail_error() {
local_whiptail_error() {
local msg=$1
if [ "$msg" = "" ]; then
die "whiptail error: An error msg is required"
@ -71,7 +71,7 @@ whiptail_error() {
}
whiptail_error_die() {
whiptail_error "$@"
local_whiptail_error "$@"
die
}
@ -1111,7 +1111,7 @@ if [ "$GPG_GEN_KEY_IN_MEMORY" = "n" -o "$GPG_GEN_KEY_IN_MEMORY_COPY_TO_SMARTCARD
echo -e "\nChecking for USB Security Dongle...\n"
enable_usb
if ! gpg --card-status >/dev/null 2>&1; then
whiptail_error "Can't access USB Security Dongle; \nPlease remove and reinsert, then press Enter."
local_whiptail_error "Can't access USB Security Dongle; \nPlease remove and reinsert, then press Enter."
if ! gpg --card-status >/dev/null 2>/tmp/error; then
ERROR=$(tail -n 1 /tmp/error | fold -s)
whiptail_error_die "Unable to detect USB Security Dongle:\n\n${ERROR}"