#!/usr/bin/env bash # This file is in the public domain. # Script for basic diagnostics of a Taler regio deployment. # @author Florian Dold if [ "$(id -u)" -ne 0 ]; then echo "FATAL: Please run as root." >&2 exit 1 fi libeufin_bank_db=$(libeufin-bank config get libeufin-bankdb-postgres config) libeufin_nexus_db=$(libeufin-nexus config get libeufin-nexusdb-postgres config) exchange_db=$(taler-config -s exchangedb-postgres -o config) if [[ $libeufin_nexus_db != $libeufin_bank_db ]]; then echo "FATAL: libeufin-bank and libeufin-nexus don't share the same database" >&2 exit 1 fi libeufin_db=$libeufin_bank_db # runsql db RESNAME < query function runsql() { local sql read -r -d '' sql res=$(cd / && sudo -u postgres psql "$1" -t --csv -c "$sql") printf -v "$2" '%s' "$res" } # # Check for conversion trigger # runsql "$libeufin_db" have_conversion_triggers <