commit e035bc223cf393655f2118fb1a807956055c2bfa
parent 91efcea13b1bc884245112272519f9c4a6861d70
Author: Christian Grothoff <grothoff@gnunet.org>
Date: Mon, 13 Jul 2026 20:49:40 +0200
clean up challenger-dbconfig
Diffstat:
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/contrib/challenger-dbconfig b/contrib/challenger-dbconfig
@@ -22,13 +22,12 @@ set -eu
RESET_DB=0
SKIP_DBINIT=0
DBUSER="challenger-httpd"
-DBNAME="challenger"
CFGFILE="/etc/challenger/challenger.conf"
# Parse command-line options
-while getopts 'c:hn:rsu:' OPTION; do
+while getopts 'c:hrsu:' OPTION; do
case "$OPTION" in
c)
CFGFILE="$OPTARG"
@@ -37,15 +36,11 @@ while getopts 'c:hn:rsu:' OPTION; do
echo 'Supported options:'
echo " -c FILENAME -- write configuration to FILENAME (default: $CFGFILE)"
echo " -h -- print this help text"
- echo " -n NAME -- user NAME for database name (default: $DBNAME)"
echo " -r -- reset database (dangerous)"
echo " -s -- skip database initialization"
echo " -u USER -- challenger-httpd to be run by USER (default: $DBUSER)"
exit 0
;;
- n)
- DBNAME="$OPTARG"
- ;;
r)
RESET_DB="1"
;;
@@ -56,7 +51,7 @@ while getopts 'c:hn:rsu:' OPTION; do
DBUSER="$OPTARG"
;;
?)
- echo "Unrecognized command line option '$OPTION'" 1>&2
+ echo "Unrecognized command line option '$OPTARG'" 1>&2
exit 1
;;
esac
@@ -75,6 +70,7 @@ fi
if [ 0 = "$SKIP_DBINIT" ]; then
if ! challenger-dbinit -v 2>/dev/null; then
echo "Required 'challenger-dbinit' not found. Please fix your installation."
+ exit 1
fi
DBINIT=$(which challenger-dbinit)
fi