catch stderr as well

This commit is contained in:
Pirate Praveen 2017-12-12 22:55:51 +05:30
parent 64ad41b0b5
commit 122f7a820e

View file

@ -9,7 +9,7 @@ export DB RAILS_ENV
cd /usr/share/gitlab
# Check if the db is already present
db_relations="$(LANG=C runuser -u postgres -- sh -c "psql gitlab_production -c \"\d\"")"
db_relations="$(LANG=C runuser -u postgres -- sh -c "psql gitlab_production -c \"\d\"" 2>&1)"
if [ "$db_relations" = "No relations found." ] || \
[ "$db_relations" = "Did not find any relations." ]; then
echo "Initializing database..."