postgres-init-db: Throw an error if not run as root.

Fixes part of the dicsussion in #552.
This commit is contained in:
Tim Abbott 2018-08-21 11:36:50 -07:00
parent eaefa31969
commit 24f3419449
1 changed files with 5 additions and 0 deletions

View File

@ -1,5 +1,10 @@
#!/bin/bash
set -e
if [ "$EUID" -ne 0 ]; then
echo "Error: This script must be run as root" >&2
exit 1
fi
set -x
# What user should we use for connecting to the database