From 3be443a2ca978e382f1f7c96833cc6c5bfca2b2f Mon Sep 17 00:00:00 2001 From: kload Date: Tue, 29 Sep 2015 12:53:52 -0400 Subject: [PATCH] [fix] Set FQDN if possible to avoid amavisd installation error --- install_yunohostv2 | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/install_yunohostv2 b/install_yunohostv2 index 1f99d6d..55b167c 100755 --- a/install_yunohostv2 +++ b/install_yunohostv2 @@ -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 !