commit ea86ad5660ac66d94d315ba49d224511b2e9ac1d parent 98863bf67c61ea62574de43914107f443dabdfd2 Author: Florian Dold <florian@dold.me> Date: Tue, 11 Apr 2023 17:20:58 +0200 add diagnostics Diffstat:
| M | netzbon/setup-exchange.sh | | | 10 | +++++++++- |
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/netzbon/setup-exchange.sh b/netzbon/setup-exchange.sh @@ -38,6 +38,14 @@ if test -z ${EXCHANGE_PAYTO:-}; then exit 1 fi +function die() { + say $1 + exit 1 +} + +# Just try if sudo works for diagnostics +sudo -i -u taler-exchange-offline id >/dev/null || die "Error: Unable to switch to taler-exchange-offline user" + # Create master key as taler-exchange-offline *unless* user already # set the MASTER_PUBLIC_KEY to some value we can use. export MASTER_PRIV_DIR=.local/share/taler/exchange/offline-keys @@ -54,7 +62,7 @@ if test -z ${MASTER_PUBLIC_KEY:-}; then "SECM_TOFU_FILE=\$HOME/${SECMOD_TOFU_FILE}\n" \ >/etc/taler/conf.d/offline-setup.conf - MASTER_PUBLIC_KEY=$(sudo -i -u taler-exchange-offline taler-exchange-offline setup) + MASTER_PUBLIC_KEY=$(sudo -i -u taler-exchange-offline taler-exchange-offline -LDEBUG setup) echo "MASTER_PUBLIC_KEY=\"${MASTER_PUBLIC_KEY}\"" >>config/user.conf if test -z ${DO_OFFLINE:-}; then # Set 'DO_OFFLINE'