anastasis

Credential backup and recovery protocol and service
Log | Files | Refs | Submodules | README | LICENSE

commit 558d0ffa639e1c4d16f25c8f29ddc6b626a17605
parent 4205c9b506d7b495586314cd6db09ca57c0c074e
Author: Christian Grothoff <christian@grothoff.org>
Date:   Fri, 11 Aug 2023 20:43:09 +0200

allow -h without root

Diffstat:
Mcontrib/anastasis-dbconfig | 24++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/contrib/anastasis-dbconfig b/contrib/anastasis-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="anastasis-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 ! anastasis-dbinit -v 2> /dev/null