diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-08-11 20:43:05 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-08-11 20:43:05 +0200 |
commit | 525426db10c179fcacd19487f6c22cac837b2d40 (patch) | |
tree | 785598d0ced55c42afd457c8f351194d98284b9b /contrib | |
parent | 298085104a52887dc372ada6d353d02dac5ce933 (diff) |
allow -h without root
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/taler-merchant-dbconfig | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/contrib/taler-merchant-dbconfig b/contrib/taler-merchant-dbconfig index 18318d85..fbb25ced 100755 --- a/contrib/taler-merchant-dbconfig +++ b/contrib/taler-merchant-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-merchant-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-merchant-dbinit -v 2> /dev/null |