summaryrefslogtreecommitdiff
path: root/bin/taler-deployment-config-generate
blob: 6b87154882b9a68f5140b076ef73c445337352d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash

# Generate the taler configuration based on environment variables.
# These variables are usually defined in $HOME/activate.
# Some configuration files still need to be signed with taler-deployment-config-sign.
# It overwrites previous config files.
#
#

set -eu

if [[ -z ${TALER_CONFIG_ENV+x} ]]; then
  echo "TALER_CONFIG_ENV not set"
  exit 1
fi

if [[ -z ${TALER_CONFIG_CURRENCY+x} ]]; then
  echo "TALER_CONFIG_CURRENCY not set"
  exit 1
fi

EXCHANGE_PUB=$(gnunet-ecc -p $HOME/deployment/private-keys/${TALER_CONFIG_ENV}-exchange-master.priv)

$HOME/deployment/config/generate-config \
  --exchange-pub "$EXCHANGE_PUB" \
  --currency "$TALER_CONFIG_CURRENCY" \
  --outdir $HOME/.config \
  --envname "$TALER_CONFIG_ENV"