From 81053857f1d47c3ffb070a2d156b555907e251db Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 6 Jan 2020 22:21:47 +0100 Subject: [PATCH] #833 fix just enter key --- home.admin/config.scripts/lnd.autounlock.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/home.admin/config.scripts/lnd.autounlock.sh b/home.admin/config.scripts/lnd.autounlock.sh index 6e2bd2728..ab2b1e579 100755 --- a/home.admin/config.scripts/lnd.autounlock.sh +++ b/home.admin/config.scripts/lnd.autounlock.sh @@ -20,7 +20,6 @@ passwordC=$2 # run interactive if 'turn on' && no further parameters if [ "${turn}" = "on" ] && [ ${#passwordC} -eq 0 ]; then - echo "!!!CANCEL!!!" > ./.tmp dialog --backtitle "LND Auto-Unlock" --inputbox "ENTER your PASSWORD C: For more details see chapter in GitHub README @@ -29,20 +28,21 @@ https://github.com/rootzoll/raspiblitz Password C will be stored on the device. " 13 52 2>./.tmp + + wasCancel=$( echo $? ) passwordC=$( cat ./.tmp ) - # test if empty or CANCEL + if [ ${wasCancel} -eq 1 ]; then + echo "# CANCEL LND Auto-Unlock" + sleep 2 + exit 1 + fi if [ ${#passwordC} -eq 0 ]; then echo "# input cannot be empty - repeat" sleep 3 sudo /home/admin/config.scripts/lnd.autounlock.sh on exit 1 fi - if [ "${passwordC}" = "!!!CANCEL!!!" ]; then - echo "# CANCEL LND Auto-Unlock" - sleep 2 - exit 1 - fi # test if correct echo "# testing password .. please wait"