diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-08-11 20:43:13 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-08-11 20:43:13 +0200 |
commit | cac5b2ca615653a404da7ae2212194581b81574a (patch) | |
tree | 92d76385663865c8bcda33a9932dd8ccf15026af /contrib/taler-auditor-dbconfig | |
parent | 1b37347422f00edb648dfa78cd83083a2f80a9e8 (diff) |
allow -h without root
Diffstat (limited to 'contrib/taler-auditor-dbconfig')
-rwxr-xr-x | contrib/taler-auditor-dbconfig | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/contrib/taler-auditor-dbconfig b/contrib/taler-auditor-dbconfig index c1ef69544..16437d68c 100755 --- a/contrib/taler-auditor-dbconfig +++ b/contrib/taler-auditor-dbconfig @@ -19,18 +19,6 @@ # Error checking on set -eu -if ! id postgres > /dev/null -then - echo "Could not find 'postgres' user. Please install Postgresql first" - exit 1 -fi - -if [ "$(id -u)" -ne 0 ] -then - echo "This script must be run as root" - exit 1 -fi - RESET_DB=0 SKIP_DBINIT=0 DBUSER="taler-auditor-httpd" @@ -67,6 +55,18 @@ while getopts ':hn:rsu:' OPTION; do esac done +if ! id postgres > /dev/null +then + echo "Could not find 'postgres' user. Please install Postgresql first" + exit 1 +fi + +if [ "$(id -u)" -ne 0 ] +then + echo "This script must be run as root" + exit 1 +fi + if [ 0 = "$SKIP_DBINIT" ] then if ! taler-auditor-dbinit -v 2> /dev/null |