summaryrefslogtreecommitdiff
path: root/regional-currency/functions.sh
diff options
context:
space:
mode:
Diffstat (limited to 'regional-currency/functions.sh')
-rwxr-xr-xregional-currency/functions.sh11
1 files changed, 6 insertions, 5 deletions
diff --git a/regional-currency/functions.sh b/regional-currency/functions.sh
index edc824a..9e18afd 100755
--- a/regional-currency/functions.sh
+++ b/regional-currency/functions.sh
@@ -66,7 +66,7 @@ function ask_questions() {
fi
fi
if test -z "${DO_OFFLINE:-}"; then
- read -r -p "Do you want Taler Exchange keys on this server (y) or externally on another 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
@@ -84,10 +84,11 @@ function ask_questions() {
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
- if test "${TELESIGN_TEST_CODE:-y}" != "12345"; then
- say "Wrong code, rerun this script to enter the right Telesign auth info"
+ RANDOM_CODE=$RANDOM
+ echo "$RANDOM_CODE" | libeufin-tan-sms.sh $TELESIGN_PHONE
+ read -r -s "- Enter the code received by $TELESIGN_PHONE : " TELESIGN_TEST_CODE
+ if test "${TELESIGN_TEST_CODE:-y}" != "$RANDOM_CODE"; then
+ say "Wrong code got '$TELESIGN_TEST_CODE' expected '$RANDOM_CODE', rerun this script to enter the right Telesign auth info"
exit 1
fi
echo "TELESIGN_AUTH_TOKEN=\"${TELESIGN_AUTH_TOKEN}\"" >>config/user.conf