Project

General

Profile

Download (815 Bytes) Statistics
| Branch: | Tag: | Revision:
#!/bin/sh
# postinst script for foreman-pqsql
#
# see: dh_installdeb(1)

if [ ! -z "${DEBUG}" ]; then
set -x
else
set -e
fi

. /usr/share/debconf/confmodule

# if this script aborts with an error dpkg can
# hang if daemons have been started
trap db_stop EXIT

# Update gems
cd /usr/share/foreman
if [ ! -z "${DEBUG}" ]; then
bundle update --local
else
bundle update --local 2>&1 >/dev/null
fi

# Run a db:migrate if the user has created a dbfile
if [ -f /usr/share/foreman/config/database.yml ]; then
if [ ! -z "${DEBUG}" ]; then
su - foreman -s /bin/sh -c /usr/share/foreman/extras/dbmigrate || true
else
su - foreman -s /bin/sh -c /usr/share/foreman/extras/dbmigrate >/dev/null 2>&1 || true
fi
fi

# Own all the core files
chown -Rf foreman:foreman '/usr/share/foreman'

#DEBHELPER#

exit 0
(30-30/48)