summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-08-11 20:43:09 +0200
committerChristian Grothoff <christian@grothoff.org>2023-08-11 20:43:09 +0200
commit558d0ffa639e1c4d16f25c8f29ddc6b626a17605 (patch)
tree3a818b39f380c5d31783db0282b044af5b656fe6
parent4205c9b506d7b495586314cd6db09ca57c0c074e (diff)
downloadanastasis-558d0ffa639e1c4d16f25c8f29ddc6b626a17605.tar.gz
anastasis-558d0ffa639e1c4d16f25c8f29ddc6b626a17605.tar.bz2
anastasis-558d0ffa639e1c4d16f25c8f29ddc6b626a17605.zip
allow -h without root
-rwxr-xr-xcontrib/anastasis-dbconfig24
1 files changed, 12 insertions, 12 deletions
diff --git a/contrib/anastasis-dbconfig b/contrib/anastasis-dbconfig
index 1e682d8..952dc81 100755
--- 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