commit c1de9ea6b383e9b21b764ca205837b45c0ea06ed parent 61d65a19a478500904c5513226909a562c999e40 Author: MS <ms@taler.net> Date: Sun, 3 Dec 2023 17:37:48 +0100 asking fiat currency too Diffstat:
| M | netzbon/config_libeufin_nexus.sh | | | 2 | +- |
| M | netzbon/main.sh | | | 13 | ++++++++++++- |
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/netzbon/config_libeufin_nexus.sh b/netzbon/config_libeufin_nexus.sh @@ -16,7 +16,7 @@ taler-config -s nexus-postgres -o config \ # Setting the currency here allows to fake incoming payments # without manually editing the configuration. taler-config -s nexus-ebics -o currency \ - -V $CURRENCY /etc/libeufin/libeufin-nexus.conf + -V $FIAT_CURRENCY /etc/libeufin/libeufin-nexus.conf say "Setting up libeufin-nexus database" libeufin-nexus-dbconfig diff --git a/netzbon/main.sh b/netzbon/main.sh @@ -27,7 +27,7 @@ say "All configuration values asked during the setup script" say "can be changed in config/user.conf" if test -z "${CURRENCY:-}"; then - read -r -p "Enter the name of the currency (e.g. 'NETZBON'): " CURRENCY + read -r -p "Enter the name of the regional currency (e.g. 'NETZBON'): " CURRENCY # convert to all-caps CURRENCY=$(echo "${CURRENCY}" | tr a-z A-Z) # libeufin currenly doesn't like currency names less than 3 letters. @@ -37,6 +37,17 @@ if test -z "${CURRENCY:-}"; then fi echo "CURRENCY=${CURRENCY}" >>config/user.conf fi +if test -z "${FIAT_CURRENCY:-}"; then + read -r -p "Enter the name of the fiat currency (e.g. 'CHF'): " FIAT_CURRENCY + # convert to all-caps + FIAT_CURRENCY=$(echo "${FIAT_CURRENCY}" | tr a-z A-Z) + # libeufin currenly doesn't like currency names less than 3 letters. + if [[ ${#FIAT_CURRENCY} -lt 3 || ${#FIAT_CURRENCY} -gt 11 ]]; then + say "Currency name must be between 3 and 10 letters" + exit 1 + fi + echo "FIAT_CURRENCY=${FIAT_CURRENCY}" >>config/user.conf +fi if test -z "${BANK_NAME:-}"; then read -r -p "Enter the human-readable name of the bank (e.g. 'Taler Bank'): " BANK_NAME echo "BANK_NAME=\"${BANK_NAME}\"" >>config/user.conf