diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-07-25 14:10:48 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-07-25 14:10:48 +0200 |
commit | 987878469d6a3c14addd251e45f65241467e010c (patch) | |
tree | 9dc3ce8264a056c2011de4e37dc89e3e346e9011 /src/auditor/generate-auditor-basedb.sh | |
parent | a1989efdab77c0e2e0628b6d52d7195fe50eb588 (diff) |
-more script fixes
Diffstat (limited to 'src/auditor/generate-auditor-basedb.sh')
-rwxr-xr-x | src/auditor/generate-auditor-basedb.sh | 33 |
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..1e228623 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 [ -z ${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 ..." |