mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
72 lines
2.3 KiB
Bash
72 lines
2.3 KiB
Bash
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
do_configure() {
|
|
rm -rf /var/cache/moulinette/*
|
|
|
|
if [ ! -f /etc/yunohost/installed ]; then
|
|
# If apps/ is not empty, we're probably already installed in the past and
|
|
# something funky happened ...
|
|
if [ -d /etc/yunohost/apps/ ] && ls /etc/yunohost/apps/* >/dev/null 2>&1
|
|
then
|
|
echo "Sounds like /etc/yunohost/installed mysteriously disappeared ... You should probably contact the Yunohost support ..."
|
|
else
|
|
bash /usr/share/yunohost/hooks/conf_regen/01-yunohost init
|
|
bash /usr/share/yunohost/hooks/conf_regen/02-ssl init
|
|
bash /usr/share/yunohost/hooks/conf_regen/09-nslcd init
|
|
bash /usr/share/yunohost/hooks/conf_regen/46-nsswitch init
|
|
bash /usr/share/yunohost/hooks/conf_regen/06-slapd init
|
|
bash /usr/share/yunohost/hooks/conf_regen/15-nginx init
|
|
fi
|
|
else
|
|
echo "Regenerating configuration, this might take a while..."
|
|
yunohost tools regen-conf --output-as none
|
|
|
|
echo "Launching migrations..."
|
|
yunohost tools migrations run --auto
|
|
|
|
echo "Re-diagnosing server health..."
|
|
yunohost diagnosis run --force
|
|
fi
|
|
|
|
# Change dpkg vendor
|
|
# see https://wiki.debian.org/Derivatives/Guidelines#Vendor
|
|
readlink -f /etc/dpkg/origins/default | grep -q debian \
|
|
&& rm -f /etc/dpkg/origins/default \
|
|
&& ln -s /etc/dpkg/origins/yunohost /etc/dpkg/origins/default
|
|
|
|
# Yunoprompt
|
|
systemctl enable yunoprompt.service
|
|
|
|
# Yunomdns
|
|
chown avahi:avahi /etc/yunohost/mdns.yml
|
|
systemctl enable yunomdns.service
|
|
}
|
|
|
|
# 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
|
|
|
|
#DEBHELPER#
|
|
|
|
exit 0
|