yunohost/debian/postinst

59 lines
1.7 KiB
Bash

#!/bin/bash
set -e
do_configure() {
rm -rf /var/cache/moulinette/*
if [ ! -f /etc/yunohost/installed ]; then
bash /usr/share/yunohost/hooks/conf_regen/01-yunohost True
bash /usr/share/yunohost/hooks/conf_regen/02-ssl True
bash /usr/share/yunohost/hooks/conf_regen/06-slapd True
bash /usr/share/yunohost/hooks/conf_regen/15-nginx True
else
echo "Regenerating configuration, this might take a while..."
yunohost service regenconf
# restart yunohost-firewall if it's running
service yunohost-firewall status > /dev/null \
&& service yunohost-firewall restart \
|| echo "Service yunohost-firewall is not running, you should " \
"consider to start it."
fi
# update PAM configs
pam-auth-update --package
}
# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# * <old-postinst> `abort-upgrade' <new version>
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
# <new-version>
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
# <failed-install-package> <version> `removing'
# <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
configure)
do_configure
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# Enable and start yunohost-api service for non-systemd system
if [ -x /etc/init.d/yunohost-api ] && [ ! -d /run/systemd/system ]; then
update-rc.d yunohost-api defaults >/dev/null
invoke-rc.d yunohost-api start || exit $?
fi
#DEBHELPER#
exit 0