summaryrefslogtreecommitdiff
path: root/netzbon/main.sh
diff options
context:
space:
mode:
Diffstat (limited to 'netzbon/main.sh')
-rwxr-xr-xnetzbon/main.sh77
1 files changed, 14 insertions, 63 deletions
diff --git a/netzbon/main.sh b/netzbon/main.sh
index 769b407..585cf34 100755
--- a/netzbon/main.sh
+++ b/netzbon/main.sh
@@ -26,57 +26,8 @@ say ""
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 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.
- if [[ ${#CURRENCY} -lt 3 || ${#CURRENCY} -gt 11 ]]; then
- say "Currency name must be between 3 and 10 letters"
- exit 1
- 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
-fi
-if test -z "${ENABLE_TLS:-}"; then
- read -r -p "Use TLS? (y/n): " ENABLE_TLS
- echo "ENABLE_TLS=${ENABLE_TLS}" >>config/user.conf
-fi
-if test -z "${DO_OFFLINE:-}"; then
- read -r -p "Run taler-exchange-offline? (y/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
- 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: " BANK_ADMIN_PASSWORD
- echo "BANK_ADMIN_PASSWORD=$(printf '%q' "${BANK_ADMIN_PASSWORD}")" >>config/user.conf
- echo "" # force new line
-fi
-if test -z "${DOMAIN_NAME:-}"; then
- read -r -p "Enter the domain name: " DOMAIN_NAME
- # convert to lower-case
- DOMAIN_NAME=$(echo "${DOMAIN_NAME}" | tr A-Z a-z)
- echo "DOMAIN_NAME=${DOMAIN_NAME}" >>config/user.conf
-fi
+ask_questions
+
# END USER INTERACTION
# Check DNS settings
@@ -102,20 +53,20 @@ if test -z "${BANK_EXCHANGE_PASSWORD:-}"; then
echo "BANK_EXCHANGE_PASSWORD=\"${BANK_EXCHANGE_PASSWORD}\"" >>config/internal.conf
fi
-# TODO With port should be use ? ask user ?
-echo "BANK_PORT=8080" >>config/user.conf
-if test "${ENABLE_TLS:-}" == "y"; then
- PROTO="https"
-else
- PROTO="http"
+if test -z "${BANK_PORT:-}"; then
+ echo "BANK_PORT=8080" >>config/user.conf
+fi
+
+if test -z "${PROTO:-}"; then
+ if test "${ENABLE_TLS:-}" == "y"; then
+ PROTO="https"
+ else
+ PROTO="http"
+ fi
+ echo "PROTO=$PROTO">>config/internal.conf
fi
-echo "PROTO=$PROTO">>config/internal.conf
-./config_libeufin_nexus.sh
-./config_libeufin_bank.sh
-./config_nginx.sh
-./setup-exchange.sh
-./setup-merchant.sh
+config_services
# Final message to the user
say "Congratulations, you have successfully installed GNU Taler"