aboutsummaryrefslogtreecommitdiff
path: root/src/auditor/generate-auditor-basedb.sh
diff options
context:
space:
mode:
authorÖzgür Kesim <oec-taler@kesim.org>2023-07-26 04:05:39 +0200
committerÖzgür Kesim <oec-taler@kesim.org>2023-07-26 04:05:39 +0200
commit0f17931b108deacb75eafa36234de088d38be22e (patch)
tree80a55ae8dd9f849b17a5dcbb93708be3e1d172ec /src/auditor/generate-auditor-basedb.sh
parent1ce9312d0293444e55512bba69265f4671d387e9 (diff)
parenteae030fc4ff5df08eb113e49eb640e7cbe2b25cb (diff)
Merge branch 'master' of ssh://git.taler.net/exchange
Diffstat (limited to 'src/auditor/generate-auditor-basedb.sh')
-rwxr-xr-xsrc/auditor/generate-auditor-basedb.sh33
1 files changed, 29 insertions, 4 deletions
diff --git a/src/auditor/generate-auditor-basedb.sh b/src/auditor/generate-auditor-basedb.sh
index 55127fff..46e0813a 100755
--- a/src/auditor/generate-auditor-basedb.sh
+++ b/src/auditor/generate-auditor-basedb.sh
@@ -12,16 +12,41 @@
#
set -eu
-# Where do we write the result?
-BASEDB="$1"
-
. setup.sh
+CONF="generate-auditor-basedb.conf"
+# Parse command-line options
+while getopts ':c:d:h' OPTION; do
+ case "$OPTION" in
+ c)
+ CONF="$OPTARG"
+ ;;
+ d)
+ BASEDB="$OPTARG"
+ ;;
+ h)
+ echo 'Supported options:'
+# shellcheck disable=SC2016
+ echo ' -c $CONF -- set configuration'
+# shellcheck disable=SC2016
+ echo ' -d $DB -- set database name'
+ ;;
+ ?)
+ exit_fail "Unrecognized command line option"
+ ;;
+ esac
+done
+
+# Where do we write the result?
+if [ ! -v BASEDB ]
+then
+ exit_fail "-d option required"
+fi
+
echo -n "Testing for curl ..."
curl --help >/dev/null </dev/null || exit_skip " MISSING"
echo " FOUND"
-CONF="generate-auditor-basedb.conf"
# reset database
echo -n "Reset 'auditor-basedb' database at $PGHOST ..."