commit d499620973bca3310c544d835aa7b163eb1a29b4
parent 2f35fcfa0dae5b65ecc8e4fa20d23b5d5f137c13
Author: Florian Dold <florian@dold.me>
Date: Thu, 13 Nov 2025 23:05:30 +0100
address shellcheck warnings
Diffstat:
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/contrib/libeufin-dbconfig b/contrib/libeufin-dbconfig
@@ -35,11 +35,12 @@ function exit_fail() {
exit 1
}
-VALID_ARGS=$(getopt -o b:hrn:psu:v: -l bank-config:,help,nexus-config:,reset,skip,permissions,nexus-user:,bank-user:,only-nexus,only-bank -n 'libeufin-dbconfig' -- "$@")
-
-if [ $? != 0 ]; then
+short_opts=b:hrn:psu:v:
+long_opts=bank-config:,help,nexus-config:,reset,skip,permissions,nexus-user:,bank-user:,only-nexus,only-bank
+if ! VALID_ARGS=$(getopt -o "$short_opts" -l "$long_opts" -n "$0" -- "$@"); then
exit 1
fi
+
eval set -- "$VALID_ARGS"
function usage {
@@ -127,7 +128,7 @@ function check_availability {
if ! $1 --help 1>/dev/null; then
exit_fail "Required '$1' not found. Please fix your installation."
fi
- echo $(which $1)
+ which "$1"
}
if [ 0 = "$SKIP_INIT" ]; then
if [ 0 = "$SKIP_BANK" ]; then
@@ -164,7 +165,7 @@ function get_db_name {
fi
# Remove URI, host and query from postgres URI.
- echo $(echo "$1" | sed -e 's|postgres://.*/||' -e 's|?.*||')
+ echo "$1" | sed -e 's|postgres://.*/||' -e 's|?.*||'
}
if [ 0 = "$SKIP_BANK" ]; then
BANK_DBNAME=$(get_db_name "$(libeufin-bank config get libeufin-bankdb-postgres CONFIG)" "bank")