Source

timekoin / debian / postinst

#!/bin/sh

set -e
# set -x

. /usr/share/debconf/confmodule
. /usr/share/dbconfig-common/dpkg/postinst.mysql

unset LANG

dbc_dbfile_owner="www-data:www-data"
dbc_dbfile_perms="0660"
dbc_generate_include="php:/etc/timekoin/dbconfig.php"
dbc_generate_include_owner="root:www-data"
dbc_generate_include_perms="640"
# dbc_mysql_createdb_encoding=""
# could perhaps set the collation here

dbc_go timekoin $@

ln -s /etc/timekoin/apache.conf /etc/apache2/conf.d/timekoin.conf >/dev/null 2>/dev/null || true

generate-timekoin-keys --quiet

# Reload apache2 if it is running
if service apache2 status >/dev/null 2>/dev/null; then
    service apache2 reload || true
fi

chown -R www-data:www-data /var/lib/timekoin
chown -R www-data:www-data /var/log/timekoin

#DEBHELPER#