authentic.conf: test if db.con exists

This commit is contained in:
Jérôme Schneider 2013-11-19 11:33:32 +01:00
parent 9fdcea9642
commit 811702e340
2 changed files with 13 additions and 12 deletions

View File

@ -46,4 +46,4 @@ export EMAIL_SUBJECT_PREFIX='[Authentic2]'
#
# do not remove this line, it imports db configuration from dbconfig-common
. /etc/authentic2/db.conf
[ -f /etc/authentic2/db.conf ] && . /etc/authentic2/db.conf

View File

@ -33,6 +33,18 @@ case "$1" in
su authentic -p -c "/usr/bin/authentic2-ctl collectstatic --noinput --link"
echo "..done"
# source debconf stuff
. /usr/share/debconf/confmodule
# source dbconfig-common shell library, and call the hook function
if [ -f /usr/share/dbconfig-common/dpkg/postinst.pgsql ]; then
. /usr/share/dbconfig-common/dpkg/postinst.pgsql
dbc_generate_include=template:/etc/authentic2/db.conf
dbc_generate_include_args="-o template_infile=/usr/share/authentic2/templates/db.conf -U"
dbc_generate_include_owner="authentic"
dbc_generate_include_perms="640"
dbc_go authentic2 $@
fi
;;
reconfigure)
@ -51,17 +63,6 @@ case "$1" in
;;
esac
# source debconf stuff
. /usr/share/debconf/confmodule
# source dbconfig-common shell library, and call the hook function
if [ -f /usr/share/dbconfig-common/dpkg/postinst.pgsql ]; then
. /usr/share/dbconfig-common/dpkg/postinst.pgsql
dbc_generate_include=template:/etc/authentic2/db.conf
dbc_generate_include_args="-o template_infile=/usr/share/authentic2/templates/db.conf -U"
dbc_generate_include_owner="authentic"
dbc_generate_include_perms="640"
dbc_go authentic2 $@
fi
# dh_installdeb will replace this with shell code automatically