mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
86 lines
2.7 KiB
Bash
86 lines
2.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 \
|
|
&& 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..."
|
|
|
|
if [ -x /etc/init.d/yunohost-firewall ]; then
|
|
update-rc.d yunohost-firewall defaults >/dev/null || true
|
|
if [ -d /run/systemd/system ]; then
|
|
systemctl --system daemon-reload >/dev/null || true
|
|
else
|
|
invoke-rc.d yunohost-firewall start >/dev/null || true
|
|
fi
|
|
fi
|
|
|
|
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
|
|
fi
|
|
deb-systemd-helper update-state yunohost-firewall.service >/dev/null || true
|
|
if [ -d /run/systemd/system ]; then
|
|
systemctl --system daemon-reload >/dev/null || true
|
|
deb-systemd-invoke try-restart yunohost-firewall.service >/dev/null || true
|
|
fi
|
|
}
|
|
|
|
# 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 sysv service
|
|
if [ -x /etc/init.d/yunohost-api ]; then
|
|
update-rc.d yunohost-api defaults >/dev/null
|
|
if [ -d /run/systemd/system ]; then
|
|
systemctl --system daemon-reload >/dev/null || true
|
|
else
|
|
invoke-rc.d yunohost-api start || exit $?
|
|
fi
|
|
fi
|
|
|
|
#DEBHELPER#
|
|
|
|
exit 0
|