#!/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 \ && restart_yunohost_firewall \ || echo "Service yunohost-firewall is not running, you should " \ "consider to start it by doing 'service yunohost-firewall start'." fi # update PAM configs pam-auth-update --package } restart_yunohost_firewall() { echo "Restarting YunoHost firewall..." deb-systemd-helper unmask yunohost-firewall.service >/dev/null || true if deb-systemd-helper --quiet was-enabled yunohost-firewall.service; then deb-systemd-helper enable yunohost-firewall.service >/dev/null || true else deb-systemd-helper update-state yunohost-firewall.service >/dev/null || true fi if [ -x /etc/init.d/yunohost-firewall ]; then update-rc.d yunohost-firewall defaults >/dev/null if [ -n "$2" ]; then invoke-rc.d yunohost-firewall restart >/dev/null || exit $? fi fi } # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-deconfigure' `in-favour' # `removing' # # 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 #DEBHELPER# exit 0