From a5ad1dd966f17a085607c3d4ed3b629d35c94268 Mon Sep 17 00:00:00 2001 From: Antoine A <> Date: Tue, 20 Feb 2024 16:04:09 +0100 Subject: Improve regional currency script --- regional-currency/functions.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/regional-currency/functions.sh b/regional-currency/functions.sh index 3dc2626..edc824a 100755 --- a/regional-currency/functions.sh +++ b/regional-currency/functions.sh @@ -50,14 +50,14 @@ function ask_questions() { fi if test -z "${TLS_EMAIL:-}"; then if test "${ENABLE_TLS:-}" == y; then - read -r -p "Enter an email address for Let's Encrypt: " TLS_EMAIL + read -r -p "- Enter an email address for Let's Encrypt: " TLS_EMAIL echo "TLS_EMAIL=${TLS_EMAIL}" >>config/user.conf fi fi if test -z "${TLS_TOS:-}"; then if test "${ENABLE_TLS:-}" == y; then - echo "Please read the Terms of Service at https://letsencrypt.org/documents/LE-SA-v1.3-September-21-2022.pdf." - read -r -p "You must agree in order to register with the ACME server. Do you agree? (y/n): " TLS_TOS + echo "- Please read the Terms of Service at https://letsencrypt.org/documents/LE-SA-v1.3-September-21-2022.pdf." + read -r -p "- You must agree in order to register with the ACME server. Do you agree? (y/n): " TLS_TOS if test "${TLS_TOS:-y}" != y; then say "You must agree in order to register with the ACME server" exit 1 @@ -66,31 +66,26 @@ function ask_questions() { fi fi if test -z "${DO_OFFLINE:-}"; then - read -r -p "Do you want Taler Exchange keys in this server (y), or externally in other server (n) ?" DO_OFFLINE + read -r -p "Do you want Taler Exchange keys on this server (y) or externally on another server (n) ?" DO_OFFLINE echo "DO_OFFLINE=${DO_OFFLINE}" >>config/user.conf fi if test -z "${MASTER_PUBLIC_KEY:-}"; then if test "${DO_OFFLINE:-y}" == n; then - read -r -p "Enter the exchange-offline master public key: " MASTER_PUBLIC_KEY + read -r -p "- Enter the exchange-offline master public key: " MASTER_PUBLIC_KEY echo "MASTER_PUBLIC_KEY=${MASTER_PUBLIC_KEY}" >>config/user.conf fi fi - if test -z "${BANK_ADMIN_PASSWORD:-}"; then - read -r -s -p "Enter the admin password for the bank (or press enter to autogenerate password): " BANK_ADMIN_PASSWORD - echo "BANK_ADMIN_PASSWORD=$(printf '%q' "${BANK_ADMIN_PASSWORD}")" >>config/user.conf - echo "" # force new line - fi if test -z "${DO_TELESIGN:-}"; then read -r -p "Setup sms two-factor authentication using Telesign https://www.telesign.com? (y/n): " DO_TELESIGN if test "${DO_TELESIGN:-y}" != n; then - read -r -p "Enter your Telesign Customer ID: " TELESIGN_CUSTOMER_ID - read -r -s -p "Enter your Telesign API Key: " TELESIGN_API_KEY + read -r -p "- Enter your Telesign Customer ID: " TELESIGN_CUSTOMER_ID + read -r -s -p "- Enter your Telesign API Key: " TELESIGN_API_KEY echo "" # force new line - read -r -p "Enter a phone number to test your API key (e.g. '+447911123456'): " TELESIGN_PHONE + read -r -p "- Enter a phone number to test your API key (e.g. '+447911123456'): " TELESIGN_PHONE TELESIGN_AUTH_TOKEN=$(echo "$TELESIGN_CUSTOMER_ID:$TELESIGN_API_KEY" | base64 -w 0) export AUTH_TOKEN=$TELESIGN_AUTH_TOKEN echo "12345" | libeufin-tan-sms.sh $TELESIGN_PHONE - read -r -s -p "Enter the code received by $TELESIGN_PHONE : " TELESIGN_TEST_CODE + read -r -s -p "- Enter the code received by $TELESIGN_PHONE : " TELESIGN_TEST_CODE if test "${TELESIGN_TEST_CODE:-y}" != "12345"; then say "Wrong code, rerun this script to enter the right Telesign auth info" exit 1 @@ -99,6 +94,11 @@ function ask_questions() { fi echo "DO_TELESIGN=${DO_TELESIGN}" >>config/user.conf fi + if test -z "${BANK_ADMIN_PASSWORD:-}"; then + read -r -s -p "Enter the admin password for the bank (or press enter to autogenerate password): " BANK_ADMIN_PASSWORD + echo "BANK_ADMIN_PASSWORD=$(printf '%q' "${BANK_ADMIN_PASSWORD}")" >>config/user.conf + echo "" # force new line + fi } function normalize_currency() { -- cgit v1.2.3