aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2024-11-05 11:21:49 +0100
committerFlorian Dold <florian@dold.me>2024-11-05 11:22:06 +0100
commitc6e8b12b433931b73b5632747fb54671a8cf57d7 (patch)
treeb4729c6bb1a0d2c6846c8550a575d8d3cadab34e
parent7adadeb4602023dec3da56d1e1be7ffac191a1bc (diff)
kyc: add taler-exchange-helper-measure-none
-rwxr-xr-xsrc/kyclogic/taler-exchange-helper-measure-none79
1 files changed, 79 insertions, 0 deletions
diff --git a/src/kyclogic/taler-exchange-helper-measure-none b/src/kyclogic/taler-exchange-helper-measure-none
new file mode 100755
index 000000000..182fa1f33
--- /dev/null
+++ b/src/kyclogic/taler-exchange-helper-measure-none
@@ -0,0 +1,79 @@
+#!/bin/bash
+#
+# This file is part of TALER
+# Copyright (C) 2014-2024 Taler Systems SA
+#
+# TALER is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 3, or (at your option) any later version.
+#
+# TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# TALER; see the file COPYING. If not, If not, see <http://www.gnu.org/license>
+
+# This AMP is used as a dummy program for measures that just use an INFO check.
+#
+# It program fails when running it, but correctly responds to commands that try
+# to inspect it.
+
+# Hard error reporting on.
+set -eu
+
+# Exit, with error message (hard failure)
+function exit_fail() {
+ echo " FAIL: " "$@" >&2
+ EXIT_STATUS=1
+ exit "$EXIT_STATUS"
+}
+
+CONF="$HOME/.config/taler.conf"
+VERBOSE=0
+
+while getopts 'ac:hrvV' OPTION; do
+ case "$OPTION" in
+ a)
+ # No attributes are required.
+ exit 0
+ ;;
+ c)
+ # shellcheck disable=SC2034
+ CONF="$OPTARG"
+ ;;
+ h)
+ echo "This is a KYC measure program that freezes the account and flags it for manual investigation. This is the ultimate fallback measure."
+ echo 'Supported options:'
+ echo ' -a -- show required attributes'
+ # shellcheck disable=SC2016
+ echo ' -c $CONF -- set configuration'
+ echo ' -h -- print this help'
+ echo ' -r -- show required context'
+ echo ' -v -- show version'
+ echo ' -V -- be verbose'
+ ;;
+ r)
+ # No context is required.
+ exit 0
+ ;;
+ v)
+ echo "$0 v0.0.0"
+ exit 0
+ ;;
+ V)
+ VERBOSE=1
+ ;;
+ ?)
+ exit_fail "Unrecognized command line option"
+ ;;
+ esac
+done
+
+if [ 1 = "$VERBOSE" ]; then
+ echo "Running $0" 1>&2
+fi
+
+echo "FATAL: This measure program is a dummy and should never run. Only use it for INFO checks." >&2
+
+exit 1