From aa493b56977351ea06560751933ec3f9f48b8826 Mon Sep 17 00:00:00 2001 From: opi Date: Mon, 9 May 2016 13:49:12 +0200 Subject: [PATCH] [enh] Stable is 2.4 now, Jessie only. --- install_yunohostv2 | 113 +++++++++++++-------------------------------- 1 file changed, 32 insertions(+), 81 deletions(-) diff --git a/install_yunohostv2 b/install_yunohostv2 index 8213849..ab261d7 100755 --- a/install_yunohostv2 +++ b/install_yunohostv2 @@ -110,13 +110,16 @@ installscript_dependencies() { } create_custom_config() { - if [[ "$DISTRIB" != "daily" ]] && [[ "$DISTRIB" != "unstable" ]] \ - && [[ "$DISTRIB" != "test" ]] && [[ "$DISTRIB" != "testing" ]] ; then - if [[ ! -f /etc/yunohost/yunohost.conf ]] - then - mkdir -p /etc/yunohost/ - touch /etc/yunohost/from_script - cat << EOF > /etc/yunohost/yunohost.conf + # Create YunoHost configuration folder + mkdir -p /etc/yunohost/ + + # Store info about installation method + touch /etc/yunohost/from_script + + # Create default configuration if not already there + if [[ ! -f /etc/yunohost/yunohost.conf ]] + then + cat << EOF > /etc/yunohost/yunohost.conf # Yunohost custom config # If you want to keep a custom service configuration replace "no" by "yes" # for the concerned service @@ -133,25 +136,9 @@ slapd=no ssh=yes ssowat=no EOF - fi - else - mkdir -p /etc/yunohost/ - touch /etc/yunohost/from_script fi } -set_domain() { - # No amavis in testing/unstable anymore - [[ "$DISTRIB" != "stable" ]] && return 0 - - 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 @@ -174,26 +161,22 @@ Are you sure you want to proceed with the installation of Yunohost? setup_package_source() { local CUSTOMAPT=/etc/apt/sources.list.d/yunohost.list - if [[ "$DISTRIB" == "megusta" ]] || [[ "$DISTRIB" == "stable" ]] ; then - echo "deb http://repo.yunohost.org/ megusta main" > $CUSTOMAPT - else - # Check current system version and dependencies - if [[ $(lsb_release -c | awk '{print $2}') != jessie ]]; then - echo "Current $DISTRIB only works on Debian Jessie for the moment." - return 1 - elif [ ! -d /run/systemd/system ]; then - echo "Current $DISTRIB only works with systemd for the moment." - return 1 - fi + # Check current system version and dependencies + if [[ $(lsb_release -c | awk '{print $2}') != jessie ]]; then + echo "Current $DISTRIB only works on Debian Jessie for the moment." + return 1 + elif [ ! -d /run/systemd/system ]; then + echo "Current $DISTRIB only works with systemd for the moment." + return 1 + fi - # Make use of new repository - local CUSTOMDEB="deb http://repo.yunohost.org/debian/ jessie stable" + # Debian repository + local CUSTOMDEB="deb http://repo.yunohost.org/debian/ jessie stable" - if [[ "$DISTRIB" == "test" ]] || [[ "$DISTRIB" == "testing" ]] ; then - echo "$CUSTOMDEB testing" >> $CUSTOMAPT - elif [[ "$DISTRIB" == "daily" ]] || [[ "$DISTRIB" == "unstable" ]] ; then - echo "$CUSTOMDEB testing unstable" > $CUSTOMAPT - fi + if [[ "$DISTRIB" == "test" ]] || [[ "$DISTRIB" == "testing" ]] ; then + echo "$CUSTOMDEB testing" >> $CUSTOMAPT + elif [[ "$DISTRIB" == "daily" ]] || [[ "$DISTRIB" == "unstable" ]] ; then + echo "$CUSTOMDEB testing unstable" > $CUSTOMAPT fi # Add YunoHost repository key to the keyring @@ -205,9 +188,7 @@ apt_update() { } register_debconf() { - if [[ $(lsb_release -c | awk '{print $2}') == jessie ]]; - then - debconf-set-selections << EOF + debconf-set-selections << EOF slapd slapd/password1 password yunohost slapd slapd/password2 password yunohost slapd slapd/domain string yunohost.org @@ -229,25 +210,6 @@ nslcd nslcd/ldap-binddn string nslcd nslcd/ldap-base string dc=yunohost,dc=org libnss-ldapd libnss-ldapd/nsswitch multiselect group, passwd, shadow EOF - else - debconf-set-selections << EOF -slapd slapd/password1 password yunohost -slapd slapd/password2 password yunohost -slapd slapd/domain string yunohost.org -slapd shared/organization string yunohost.org -postfix postfix/main_mailer_type select Internet Site -postfix postfix/mailname string /etc/mailname -mysql-server-5.5 mysql-server/root_password password yunohost -mysql-server-5.5 mysql-server/root_password_again password yunohost -nslcd nslcd/ldap-bindpw password -nslcd nslcd/ldap-starttls boolean false -nslcd nslcd/ldap-reqcert select -nslcd nslcd/ldap-uris string ldap://localhost/ -nslcd nslcd/ldap-binddn string -nslcd nslcd/ldap-base string dc=yunohost,dc=org -libnss-ldapd libnss-ldapd/nsswitch multiselect group, passwd, shadow -EOF - fi } workaround_avahi_installation() { @@ -291,21 +253,10 @@ workaround_avahi_installation() { } install_yunohost_packages() { - if [[ "$DISTRIB" != "daily" ]] && [[ "$DISTRIB" != "unstable" ]] \ - && [[ "$DISTRIB" != "test" ]] && [[ "$DISTRIB" != "testing" ]] ; then - apt_get_wrapper \ - -o Dpkg::Options::="--force-confold" \ - -y --force-yes install \ - yunohost yunohost-config \ - yunohost-config-postfix \ - postfix postfix-ldap \ - postfix-policyd-spf-perl - else - apt_get_wrapper \ - -o Dpkg::Options::="--force-confold" \ - -y --force-yes install \ - yunohost postfix - fi + apt_get_wrapper \ + -o Dpkg::Options::="--force-confold" \ + -y --force-yes install \ + yunohost postfix } restart_services() { @@ -426,9 +377,9 @@ 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 set_domain ; then +# die "Setting hostname failed" 5 +# fi if ! step confirm_installation ; then die "Installation cancelled at your request" 6