commit 74635648a0c6ab901dcbbd5a69a605a5fb29e0e6
parent f23529876c72cc3a372a37f646f192ac742c0a64
Author: Christian Grothoff <christian@grothoff.org>
Date: Sat, 13 Jan 2024 23:50:47 +0100
add FAIL_COMMAND option
Diffstat:
3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/contrib/taler-mdb-network-check.sh b/contrib/taler-mdb-network-check.sh
@@ -38,7 +38,6 @@ function exit_fail() {
}
CONF="$HOME/.config/taler.conf"
-FAIL_PROG="echo"
# Parse command-line options
while getopts ':c:f:h' OPTION; do
@@ -65,6 +64,10 @@ shift $((OPTIND - 1))
dig -h > /dev/null || exit_fail "'dig' is required"
+if [[ ${FAIL_PROG:-} = "" ]]
+then
+ FAIL_PROG=$(taler-config -c "$CONF" -s taler-mdb -o "FAIL_HELPER")
+fi
# Cleanup to run whenever we exit
function cleanup()
diff --git a/debian/etc/taler-mdb.conf b/debian/etc/taler-mdb.conf
@@ -10,6 +10,9 @@ BACKEND_AUTHORIZATION = "Bearer secret-token:sandbox"
# Message to diplay after purchase is completed,
FULFILLMENT_MSG = Enjoy your ${PRODUCT_DESCRIPTION}
+# Command to run to show failures.
+FAIL_COMMAND = taler-mdb-show.sh -c /etc/taler-mdb.conf
+
# Name of the UART where the MDB connector is reachable.
UART_DEVICE = /dev/ttyAMA0
diff --git a/debian/taler-mdb.service b/debian/taler-mdb.service
@@ -5,7 +5,7 @@ Description=GNU Taler Multi-Drop-Bus application
User=root
Type=simple
Restart=on-failure
-ExecStart=/usr/bin/taler-mdb-network-check.sh -c /etc/taler-mdb.conf -f '/usr/bin/taler-mdb-show.sh -c /etc/taler-mdb.conf' /usr/bin/taler-mdb -c /etc/taler-mdb.conf
+ExecStart=/usr/bin/taler-mdb-network-check.sh -c /etc/taler-mdb.conf -- /usr/bin/taler-mdb -c /etc/taler-mdb.conf
StandardOutput=inherit
StandardError=inherit
Restart=always