From 7be9964a90ae7be2c4405d0f9f4c6bcad450a842 Mon Sep 17 00:00:00 2001 From: /geco Date: Mon, 24 Dec 2018 01:21:05 +0100 Subject: [PATCH] added retun info --- home.admin/00mainMenu.sh | 4 +++- home.admin/config.scripts/lnd.autounlock.sh | 18 +++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/home.admin/00mainMenu.sh b/home.admin/00mainMenu.sh index 27dd4a11..0a8d66cf 100755 --- a/home.admin/00mainMenu.sh +++ b/home.admin/00mainMenu.sh @@ -396,7 +396,9 @@ case $CHOICE in ;; X) lncli -h - echo "SUCH WOW come back with ./00mainMenu.sh" + echo "OK you now on the command line." + echo "You can return to the main menu with the command:" + echo "raspiblitz" ;; R) ./00mainMenu.sh diff --git a/home.admin/config.scripts/lnd.autounlock.sh b/home.admin/config.scripts/lnd.autounlock.sh index f6efe77f..0eddea9d 100755 --- a/home.admin/config.scripts/lnd.autounlock.sh +++ b/home.admin/config.scripts/lnd.autounlock.sh @@ -26,8 +26,24 @@ https://github.com/rootzoll/raspiblitz Password C will be stored on the device. " 13 52 2>./.tmp passwordC=$( cat ./.tmp ) + + # test if empty if [ ${#passwordC} -eq 0 ]; then - echo "FAIL input cannot be empty" + echo "CANCEL input cannot be empty" + sleep 3 + exit 1 + fi + + # test if correct + echo "testing password" + sudo systemctl restart lnd + sleep 4 + result=$(sudo python /home/admin/config.scripts/lnd.unlock.py ${passwordC}) + invalid=$(echo "${result}" | grep -c 'invalid') + if [ ${invalid} -gt 0 ];then + echo "PASSWORD C is wrong - try again or cancel" + sleep 3 + sudo /home/admin/config.scripts/lnd.autounlock.sh on exit 1 fi shred ./.tmp