From 27247aceda7754a8803bbc107fa9a5a08be05c02 Mon Sep 17 00:00:00 2001 From: Jeremy Brubaker Date: Fri, 10 Jun 2022 09:49:08 -0400 Subject: Implement 'RESET' command Reset everything to defaults --- anypinentry | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/anypinentry b/anypinentry index d5e1a35..e17bab0 100755 --- a/anypinentry +++ b/anypinentry @@ -8,9 +8,10 @@ if [ -z "$DISPLAY" ]; then DISPLAY=":1"; export DISPLAY; fi +prompt_string_default="PIN: " title=""; -prompt_string="PIN: "; +prompt_string="$prompt_string_default"; description=""; keyinfo=""; repeat=""; @@ -46,7 +47,17 @@ not_implemented_error() { echo "ERR 536870981 Not implemented "; } - +reset() { + description= + prompt_string="$prompt_string_default" + keyinfo= + repeat= + error__password_mismatch= + setok= + setnotok= + setcancel= + title= +} save_option() { echo "OK"; @@ -134,7 +145,7 @@ interpret_command() { OPTION) save_option "$data" ;; BYE) echo "OK closing connection"; exit 0 ;; AUTH) not_implemented_error ;; - RESET) not_implemented_error ;; + RESET) reset ;; END) not_implemented_error ;; HELP) pinentry_help ;; SETDESC) description="$data"; echo "OK" ;; -- cgit v1.3.1