From bfb6dcbf9685ef481f2fbd0a8a4a2507f294dbfa Mon Sep 17 00:00:00 2001 From: Rodrigo Souto Date: Mon, 2 May 2016 20:37:18 +0000 Subject: [PATCH] Merge branch 'noosfero-chat-db-dependency' into 'master' --- debian/noosfero-chat.postinst | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/debian/noosfero-chat.postinst b/debian/noosfero-chat.postinst index 38887da..114105a 100644 --- a/debian/noosfero-chat.postinst +++ b/debian/noosfero-chat.postinst @@ -21,10 +21,17 @@ echo " [database = $noosfero_database]" echo 'Creating ejabberd schema ...' . /etc/default/noosfero noosfero_user="$NOOSFERO_USER" -su - postgres -c "psql -c 'GRANT CREATE ON DATABASE $noosfero_database TO $noosfero_user;' > /dev/null" + +if dpkg -s postgresql &> /dev/null ; then + su - postgres -c "psql -c 'GRANT CREATE ON DATABASE $noosfero_database TO $noosfero_user;' > /dev/null" +else + echo "[W]: No postgres installed. You're probably using noosfero's database in another machine. Make sure user $noosfero_user has CREATE permissions on $noosfero_database database by running:" + echo " => GRANT CREATE ON DATABASE $noosfero_database TO $noosfero_user;" +fi + su - $noosfero_user -c 'rails dbconsole production < /usr/share/noosfero/util/chat/postgresql/ejabberd.sql > /dev/null' -if which update-noosfero-odbc > /dev/null ; then +if which update-noosfero-odbc &> /dev/null ; then update-noosfero-odbc fi -- libgit2 0.21.2