[fix] Set FQDN if possible to avoid amavisd installation error

This commit is contained in:
kload 2015-09-29 12:53:52 -04:00
parent c2dbb333ae
commit 3be443a2ca

View file

@ -120,7 +120,6 @@ metronome=no
mysql=no
nginx=no
postfix=no
samba=no
slapd=no
ssh=yes
ssowat=no
@ -128,6 +127,15 @@ EOF
fi
}
set_domain() {
dpkg -l | grep amavisd-new | grep -e "^ii" > /dev/null 2>&1 \
|| [[ "$(hostname -d 2>/dev/null)" != "" ]] \
|| hostname yunohost.yunohost.org > /dev/null 2>&1 \
|| (echo "Unable to set an fully-qualified domain name to this \
container, amavisd installation will fail. Please set a fqdn \
manually before launching the installation." && exit 1)
}
confirm_installation() {
[[ "$AUTOMODE" == "1" ]] && return 0
@ -382,36 +390,40 @@ if ! step create_custom_config ; then
die "Creating custom configuration file /etc/yunohost/yunohost.conf failed" 4
fi
if ! step set_domain ; then
die "Setting hostname failed" 5
fi
if ! step confirm_installation ; then
die "Installation cancelled at your request" 5
die "Installation cancelled at your request" 6
fi
if ! step setup_package_source ; then
die "Setting up deb package sources failed" 6
die "Setting up deb package sources failed" 7
fi
if ! step apt_update ; then
die "Error caught during 'apt-get update'" 7
die "Error caught during 'apt-get update'" 8
fi
if ! step register_debconf ; then
die "Unable to insert new values into debconf database" 8
die "Unable to insert new values into debconf database" 9
fi
if ! step workaround_avahi_installation ; then
die "Unable to install workaround for avahi installation" 9
die "Unable to install workaround for avahi installation" 10
fi
if ! step install_yunohost_packages ; then
die "Installation of Yunohost packages failed" 10
die "Installation of Yunohost packages failed" 11
fi
if ! step restart_services ; then
die "Error caught during services restart" 11
die "Error caught during services restart" 12
fi
if ! step post_install ; then
die "Post-installation failed" 12
die "Post-installation failed" 13
fi
# Success !