diff --git a/install_sympa.sh b/install_sympa.sh index 1beb6bf..792a92e 100755 --- a/install_sympa.sh +++ b/install_sympa.sh @@ -12,125 +12,6 @@ backup_date="$(date +%Y-%m-%d-%H%M)" err_log="$(mktemp)" -_required_debian_packages=" - libauthcas-perl - libclass-singleton-perl - libdatetime-timezone-perl - libdatetime-format-mail-perl - libdbd-csv-perl - libdbd-odbc-perl - libdbd-mysql-perl - libdbd-odbc-perl - libdbd-sybase-perl - libdbd-pg-perl - libdbd-sqlite3-perl - libfile-nfslock-perl - libutf8-all-perl - libmime-base64-perl - libmime-charset-perl - libcrypt-openssl-x509-perl - libcrypt-smime-perl - libdata-password-perl - libproc-processtable-perl - libdbi-perl - libdbi-test-perl - libarchive-zip-perl - libmailtools-perl - libmsgcat-perl - libmime-tools-perl - libio-stringy-perl - libnet-ldap-perl - libcgi-fast-perl - libintl-perl - libmime-charset-perl - libmime-encwords-perl - libtemplate-perl - libxml-libxml-perl - perl-modules - libcgi-pm-perl - libhtml-stripscripts-parser-perl - libhtml-tree-perl - libhtml-format-perl - mhonarc - libregexp-common-perl - ca-certificates - lsb-base - libdbd-mysql-perl - libfcgi-perl - libfile-copy-recursive-perl - libnet-netmask-perl - libterm-progressbar-perl - libmime-lite-html-perl - libunicode-linebreak-perl - libio-socket-ssl-perl - libsoap-lite-perl - libmail-sendmail-perl - libmail-dkim-perl - cpanminus - spawn-fcgi - " - -_needed_cpan_modules=" - CPAN - Archive::Zip - CGI - Class::Singleton - DBD::mysql - DBI - DateTime::Format::Mail - DateTime::TimeZone - Digest::MD5 - Encode - File::Copy::Recursive - File::NFSLock - File::Path - HTML::FormatText - HTML::StripScripts::Parser - HTML::TreeBuilder - IO::File - IO::Scalar - LWP::UserAgent - List::Util::XS - Locale::Messages - MHonArc::UTF8 - MIME::Base64 - MIME::Charset - MIME::EncWords - MIME::Lite::HTML - MIME::Tools - Mail::Address - Net::CIDR - Net::DNS - Sys::Syslog - Template - Term::ProgressBar - Text::LineFold - Time::HiRes - URI::Escape - XML::LibXML - AuthCAS - CGI::Fast - Clone - Crypt::CipherSaber - Crypt::OpenSSL::X509 - Crypt::SMIME - DBD::CSV - DBD::ODBC - DBD::Pg - DBD::SQLite - DBD::Sybase - Data::Password - Encode::Locale - FCGI - IO::Socket::SSL - Mail::DKIM::Verifier - Net::DNS - Net::LDAP - Net::SMTP - SOAP::Lite - " - - ## --- some functions ## --- @@ -196,11 +77,163 @@ echo_skipped() { echo_wait(){ echo -en "\033[75G[ \033[5m\033[1mwait\033[m ]" } + +detect_os_1 () { + + if $(which lsb_release > /dev/null 2>&1) ; then + + os_dist="$(lsb_release -i | awk '{print tolower($3)}')" + os_version="$(lsb_release -r | awk '{print tolower($2)}')" + os_codename="$(lsb_release -c | awk '{print tolower($2)}')" + + if [[ "$os_dist" = "debian" ]]; then + if $(echo "$os_version" | grep -q '\.') ; then + os_version=$(echo "$os_version" | cut --delimiter='.' -f1) + fi + fi + + elif [[ -e "/etc/os-release" ]]; then + + . /etc/os-release + + os_dist=$ID + os_version=${VERSION_ID} + + fi + + # remove whitespace from os_dist and os_version + os_dist="${os_dist// /}" + os_version="${os_version// /}" + +} + ## --- ## --- END: functions trap clean_up SIGHUP SIGINT SIGTERM +_required_debian_packages=" + build-essential + ca-certificates + cpanminus + libarchive-zip-perl + libauthcas-perl + libcgi-fast-perl + libcgi-pm-perl + libclass-singleton-perl + libcrypt-openssl-x509-perl + libcrypt-smime-perl + libdata-password-perl + libdatetime-format-mail-perl + libdatetime-timezone-perl + libdbd-csv-perl + libdbd-mysql-perl + libdbd-pg-perl + libdbd-sqlite3-perl + libdbd-sybase-perl + libdbi-perl + libdbi-test-perl + libfcgi-perl + libfile-copy-recursive-perl + libfile-nfslock-perl + libhtml-format-perl + libhtml-stripscripts-parser-perl + libhtml-tree-perl + libintl-perl + libio-socket-ssl-perl + libio-stringy-perl + libmail-dkim-perl + libmail-sendmail-perl + libmailtools-perl + libmime-base64-perl + libmime-charset-perl + libmime-encwords-perl + libmime-lite-html-perl + libmime-tools-perl + libmsgcat-perl + libnet-ldap-perl + libnet-netmask-perl + libproc-processtable-perl + libregexp-common-perl + libsoap-lite-perl + libtemplate-perl + libterm-progressbar-perl + libunicode-linebreak-perl + libutf8-all-perl + libxml-libxml-perl + lsb-base + mhonarc + perl-modules + spawn-fcgi + unixodbc + unixodbc-dev +" + +if [[ "$os_dist" = "debian" ]] && [[ $os_version -lt 13 ]] ; then + _required_debian_packages="${_required_debian_packages} + libdbd-odbc-perl" +fi + +_needed_cpan_modules=" + CPAN + Archive::Zip + CGI + Class::Singleton + DBD::mysql + DBI + DateTime::Format::Mail + DateTime::TimeZone + Digest::MD5 + Encode + File::Copy::Recursive + File::NFSLock + File::Path + HTML::FormatText + HTML::StripScripts::Parser + HTML::TreeBuilder + IO::File + IO::Scalar + LWP::UserAgent + List::Util::XS + Locale::Messages + MHonArc::UTF8 + MIME::Base64 + MIME::Charset + MIME::EncWords + MIME::Lite::HTML + MIME::Tools + Mail::Address + Net::CIDR + Net::DNS + Sys::Syslog + Template + Term::ProgressBar + Text::LineFold + Time::HiRes + URI::Escape + XML::LibXML + AuthCAS + CGI::Fast + Clone + Crypt::CipherSaber + Crypt::OpenSSL::X509 + Crypt::SMIME + DBD::CSV + DBD::ODBC + DBD::Pg + DBD::SQLite + DBD::Sybase + Data::Password + Encode::Locale + FCGI + IO::Socket::SSL + Mail::DKIM::Verifier + Net::DNS + Net::LDAP + Net::SMTP + SOAP::Lite +" + # - Support systemd ? # - _systemd="$(which systemd)" @@ -290,7 +323,7 @@ DEFAULT_SYMPA_WEB_URL="https://$SYMPA_DOMAIN/wws" [[ -n "$SYMPA_DB_PASSWD" ]] && DEFAULT_SYMPA_DB_PASSWD="$SYMPA_DB_PASSWD" [[ -n "$APPLY_LOG_NO_USER_IP" ]] && DEFAULT_APPLY_LOG_NO_USER_IP="$APPLY_LOG_NO_USER_IP" -# - +# - [[ -n "$SYMPA_SYSTEMD_DIR" ]] && DEFAULT_SYMPA_SYSTEMD_DIR="$SYMPA_SYSTEMD_DIR" @@ -363,7 +396,7 @@ apache_vhost_dir="" ## - if dpkg -l apache2 2> /dev/null | grep -e "^ii" > /dev/null 2>&1 ; then - _debian_apache_installation=true + _debian_apache_installation=true if [ -d "/etc/apache2" -a -d "/etc/apache2/sites-available" ]; then apache_vhost_dir=/etc/apache2/sites-available @@ -492,7 +525,7 @@ while [ "$DISTRIBUTION" != "Debian" -a "$DISTRIBUTION" != "other" ];do ;; 2) DISTRIBUTION="other" ;; - *) echo "" + *) echo "" echo -e "\tFalsche Eingabe ! [ 1 = Debian ; 2 = andere ]" echo "" echononl "Eingabe:" @@ -529,7 +562,7 @@ while [ "$_UPDATE_SYMPA" != "update" -a "$_UPDATE_SYMPA" != "new" ];do ;; 2) _UPDATE_SYMPA="update" ;; - *) echo "" + *) echo "" echo -e "\tFalsche Eingabe ! [ 1 = Neuinstallation ; 2 = Update ]" echo "" echononl "Eingabe:" @@ -631,7 +664,7 @@ if ! $UPDATE_SYMPA ; then fi fi fi - + if ! $POSTFIX_CONF_FILES_FOUND ; then info "Only Postfix is suported by this installation script." echo "" @@ -899,9 +932,9 @@ if $UPDATE_SYMPA ; then echo "Set aliases file." echo "" echononl "Sympa aliases file: " - read SYMPA_ALIAS_FILE + read SYMPA_ALIAS_FILE while [ "X$SYMPA_ALIAS_FILE" = "X" ]; do - echo "" + echo "" echo -e "\tInput is required!" echo "" echononl "Sympa aliases file: " @@ -927,7 +960,7 @@ else echononl "Sympa aliases file: " read SYMPA_ALIAS_FILE while [ "X$SYMPA_ALIAS_FILE" = "X" ]; do - echo "" + echo "" echo -e "\tFalsche Eingabe ! [ 1 = Debian ; 2 = andere ]" echo "" echononl "Sympa aliases file: " @@ -935,8 +968,8 @@ else done fi -fi - +fi + if ! $UPDATE_SYMPA ; then @@ -1009,7 +1042,7 @@ if ! $UPDATE_SYMPA ; then ;; 5) SYMPA_DB_TYPE="Sybase" ;; - *) echo "" + *) echo "" echo -e "\tFalsche Eingabe ! [ 1 = MySQL | 2 = SQLite | 3 = Postgres | 4 = Oracle | 5 = Sybase ]" echo "" echononl "Eingabe:" @@ -1054,7 +1087,7 @@ if ! $UPDATE_SYMPA ; then if [[ "$SYMPA_DB_TYPE" = "mysql" ]]; then DEFAULT_SYMPA_DB_PORT=3306 elif [[ "$SYMPA_DB_TYPE" = "Pg" ]]; then - DEFAULT_SYMPA_DB_PORT=5432 + DEFAULT_SYMPA_DB_PORT=5432 elif [[ "$SYMPA_DB_TYPE" = "Sybase" ]]; then DEFAULT_SYMPA_DB_PORT=2638 elif [[ "$SYMPA_DB_TYPE" = "Oracle" ]]; then @@ -1153,7 +1186,7 @@ if [[ "$SYMPA_DB_TYPE" = "mysql" ]]; then "CREATE DATABASE IF NOT EXISTS $SYMPA_DB_NAME CHARACTER SET utf8 COLLATE utf8_general_ci" if [[ $? -ne 0 ]]; then fatal "Cannot create Database \"$SYMPA_DB_NAME\"" - fi + fi mysql $mysql_credential_args -N -s -e \ "GRANT ALL ON ${SYMPA_DB_NAME}.* TO '${SYMPA_DB_USER}'@'localhost' IDENTIFIED BY '${SYMPA_DB_PASSWD}'" if [[ $? -ne 0 ]]; then @@ -1180,7 +1213,7 @@ if [[ "$SYMPA_DB_TYPE" = "mysql" ]]; then echo "$SYMPA_DB_NAME $SYMPA_DB_USER $SYMPA_DB_PASSWD" > /root/databases.txt.$SYMPA_DB_NAME ok "Creation of Database \"$SYMPA_DB_NAME\" was successfully." fi - + fi fi elif [[ "$SYMPA_DB_TYPE" = "Pg" ]] || [[ "$SYMPA_DB_TYPE" = "Oracle" ]] || [[ "$SYMPA_DB_TYPE" = "Sybase" ]]; then @@ -1190,22 +1223,22 @@ elif [[ "$SYMPA_DB_TYPE" = "Pg" ]] || [[ "$SYMPA_DB_TYPE" = "Oracle" ]] || [[ "$ warn "Databasetype is not fully supported by this script.\n\n\t Take care, an empty database '$SYMPA_DB_NAME' exists and is accessible" fi fi - + echo "" echo "--" echo "" __START_AT_BOOTTIME= -echononl "Start at boot time (yes/no) [${DEFAULT_START_AT_BOOTTIME}]: " -read __START_AT_BOOTTIME -if [ "X$__START_AT_BOOTTIME" = "X" ]; then - __START_AT_BOOTTIME=$DEFAULT_START_AT_BOOTTIME -fi -__START_AT_BOOTTIME=`echo $__START_AT_BOOTTIME | tr '[:upper:]' '[:lower:]'` -if [ "$__START_AT_BOOTTIME" = "yes" ] ; then - START_AT_BOOTTIME=true -else - START_AT_BOOTTIME=false +echononl "Start at boot time (yes/no) [${DEFAULT_START_AT_BOOTTIME}]: " +read __START_AT_BOOTTIME +if [ "X$__START_AT_BOOTTIME" = "X" ]; then + __START_AT_BOOTTIME=$DEFAULT_START_AT_BOOTTIME +fi +__START_AT_BOOTTIME=`echo $__START_AT_BOOTTIME | tr '[:upper:]' '[:lower:]'` +if [ "$__START_AT_BOOTTIME" = "yes" ] ; then + START_AT_BOOTTIME=true +else + START_AT_BOOTTIME=false fi @@ -1313,13 +1346,13 @@ fi if $UPDATE_SYMPA ; then echo "" echo "Old (current) sympa version.........: $SYMPA_OLD_VERSION" - echo " Current Installation dir.........: $CURRENT_INSTALL_DIR" + echo " Current Installation dir.........: $CURRENT_INSTALL_DIR" if [[ -z "$CURRENT_INSTALL_SYMLINK" ]]; then echo " Current Install dir symlink......: - not in use -" else echo " Current Install dir symlink......: $CURRENT_INSTALL_SYMLINK" fi - echo " Current Data base directory......: $CURRENT_SYMPA_LIST_DATA_BASE_PATH" + echo " Current Data base directory......: $CURRENT_SYMPA_LIST_DATA_BASE_PATH" if [[ -z "$CURRENT_SYMPA_LIST_DATA_SYMLINK" ]]; then echo " Current Data dir symlink.........: - not in use -" else @@ -1666,7 +1699,7 @@ echo "" if ! $UPDATE_SYMPA ; then - ## - In case of a new fresh installation sympa main configuration file should + ## - In case of a new fresh installation sympa main configuration file should ## - not exists. But if so, backup existing configuration file ## - if [ -s "${SYMPA_MAIN_CONF_DIR}/sympa.conf" ]; then @@ -1710,7 +1743,7 @@ if ! $UPDATE_SYMPA ; then fi fi - ## - Also the database should be empty (created above). If not, backup the database + ## - Also the database should be empty (created above). If not, backup the database ## - and then empty it ## - if echo "$(mysql $mysql_credential_args -N -s -e "SHOW DATABASES";)" | grep -q "$SYMPA_DB_NAME" ; then @@ -1745,7 +1778,7 @@ EOF _failed=false for _table in $_tables ; do mysql $mysql_credential_args $SYMPA_DB_NAME -N -s -e "DROP TABLE $_table" 2> /dev/null - if [ "$?" != "0" ]; then + if [ "$?" != "0" ]; then _failed=true fi done @@ -1757,7 +1790,7 @@ EOF fi fi - + fi fi @@ -1793,6 +1826,186 @@ fi echo "" + +## - Install reqired debian packages +## - + +declare -a required_debian_packages_arr +for _debian_pkg in $_required_debian_packages ; do + required_debian_packages_arr+=("$_debian_pkg") +done +> ${_logdir}/debian-install.log + +echo "" +echo -e "\tInstalling required debian packages .." + +for _debian_pkg in ${required_debian_packages_arr[@]} ; do + + echononl "\t Installing $_debian_pkg .." + if ! dpkg -l $_debian_pkg 2> /dev/null | grep -e "^ii" > /dev/null 2>&1 ; then + echo "" >> $_log_file + echo "## - Installing Debian Package \"$_debian_pkg\" .." >> $_log_file + echo "## -" >> $_log_file + echo "## - See ${_logdir}/debian-install.log for details" >> $_log_file + echo "## -" >> $_log_file + echo "apt-get install -q -y $_debian_pkg >> ${_logdir}/debian-install.log 2>&1" >> $_log_file + + echo "" >> ${_logdir}/debian-install.log + echo "## - Install $_debian_pkg" >> ${_logdir}/debian-install.log + + apt-get install -q -y $_debian_pkg >> ${_logdir}/debian-install.log 2>&1 + if [ "$?" = 0 ]; then + echo_ok + else + echo_failed + fatal "Installing debian package \"$_debian_pkg\" failed! \n + See '${_logdir}/debian-install.log' for further informations." + fi + else + echo_skipped + fi + +done + +## - Install required/optional perl modules +## - + +declare -a cpan_modules_arr +for _module in $_needed_cpan_modules ; do + cpan_modules_arr+=("$_module") +done +> ${_logdir}/cp_modul-install.log + +echo "" +echo -e "\tInstalling cpan modules .." + +for _cpan_module in ${cpan_modules_arr[@]} ; do + + echononl "\t Installing $_cpan_module .." + cpanm -q --skip-installed $_module > "${_logdir}/cp_modul-install.log" 2>&1 + if [[ "$?" -ne 0 ]] ; then + echo_failed + error "$(cat "${_logdir}/cp_modul-install.log")" + else + echo_ok + fi + +done + +info "After Installation finished, check presens of required perl modules" + +## - Generate some locales +## +echononl "\tConfigure locales used by the system (/etc/locale.gen)" +echo "" >> $_log_file +echo "## - Configure locales used by the system (/etc/locale.gen) ..." >> $_log_file +echo "## -" >> $_log_file +cat <> $_log_file +cat < /etc/locale.gen +bg_BG CP1251 +cs_CZ ISO-8859-2 +de_DE.UTF-8 UTF-8 +de_DE ISO-8859-1 +el_GR ISO-8859-7 +en_US.UTF-8 UTF-8 +en_US ISO-8859-1 +es_ES ISO-8859-1 +et_EE ISO-8859-1 +eu_ES ISO-8859-1 +fi_FI ISO-8859-1 +fr_FR ISO-8859-1 +hu_HU ISO-8859-2 +it_IT ISO-8859-1 +ja_JP.EUC-JP EUC-JP +nb_NO ISO-8859-1 +nl_NL ISO-8859-1 +oc_FR ISO-8859-1 +pl_PL ISO-8859-2 +pt_BR ISO-8859-1 +pt_PT ISO-8859-1 +ro_RO ISO-8859-2 +ru_RU ISO-8859-5 +sv_SE ISO-8859-1 +tr_TR ISO-8859-9 +zh_TW BIG5 +zh_CN GB2312 +END +EOF + cat < /etc/locale.gen +bg_BG CP1251 +cs_CZ ISO-8859-2 +de_DE.UTF-8 UTF-8 +de_DE ISO-8859-1 +el_GR ISO-8859-7 +en_US.UTF-8 UTF-8 +en_US ISO-8859-1 +es_ES ISO-8859-1 +et_EE ISO-8859-1 +eu_ES ISO-8859-1 +fi_FI ISO-8859-1 +fr_FR ISO-8859-1 +hu_HU ISO-8859-2 +it_IT ISO-8859-1 +ja_JP.EUC-JP EUC-JP +nb_NO ISO-8859-1 +nl_NL ISO-8859-1 +oc_FR ISO-8859-1 +pl_PL ISO-8859-2 +pt_BR ISO-8859-1 +pt_PT ISO-8859-1 +ro_RO ISO-8859-2 +ru_RU ISO-8859-5 +sv_SE ISO-8859-1 +tr_TR ISO-8859-9 +zh_TW BIG5 +zh_CN GB2312 +EOF +if [ "$?" = 0 ]; then + echo_ok +else + echo_failed + error "Setting locales definition in file \"/etc/locale.gen\" failed!" +fi + + +echononl "\tGenerating locales from /etc/locale.gen" +echo "" >> $_log_file +echo "## - Generating locales from /etc/locale.gen .." >> $_log_file +echo "## -" >> $_log_file +echo "locale-gen" >> $_log_file +locale-gen >> $_log_file 2>&1 +if [ "$?" = 0 ]; then + echo_ok +else + echo_failed + error "Generating locales from \"/etc/locale.gen\" failed! \n + See '${_logdir}/debian-install.log' for further informations." +fi + +echononl "\tAdd Environment Variable \"PERL5LIB\" to /etc/profile .." +if ! grep PERL5LIB /etc/profile > /dev/null 2>&1 ; then + echo "" >> $_log_file + echo "## - Add Environment Variable \"PERL5LIB\" to /etc/profile .." >> $_log_file + echo "## -" >> $_log_file + echo "echo \"export PERL5LIB=/usr/share/mhonarc\" >> /etc/profile" >> $_log_file + echo "export PERL5LIB=/usr/share/mhonarc" >> /etc/profile 2>> $_log_file + if [ "$?" = 0 ]; then + echo_ok + else + echo_failed + error "Adding Environment Variable \"PERL5LIB\" to /etc/profile failed! \n + See '${_logdir}/debian-install.log' for further informations." + fi +else + echo_skipped +fi + +## - Make PERL5LIB also present in that shell +## - +export PERL5LIB=/usr/share/mhonarc + +echo "" + if ! $UPDATE_SYMPA ; then echononl "\tAdding Group \"$SYMPA_GROUP\".." @@ -1822,7 +2035,7 @@ if ! $UPDATE_SYMPA ; then echo " --gecos \"Sympa mailing list manager\" $SYMPA_USER" >> $_log_file adduser --uid $SYMPA_UID --gid $SYMPA_GID --home $SYMPA_BASE_PATH --disabled-password \ --gecos "Sympa mailing list manager" $SYMPA_USER >> $_log_file - + if [ "$?" = "0" ]; then echo_ok else @@ -1908,184 +2121,6 @@ if ! $UPDATE_SYMPA ; then See '$_log_file' for further informations." fi - - ## - Install reqired debian packages - ## - - - declare -a required_debian_packages_arr - for _debian_pkg in $_required_debian_packages ; do - required_debian_packages_arr+=("$_debian_pkg") - done - > ${_logdir}/debian-install.log - - echo "" - echo -e "\tInstalling required debian packages .." - - for _debian_pkg in ${required_debian_packages_arr[@]} ; do - - echononl "\t Installing $_debian_pkg .." - if ! dpkg -l $_debian_pkg 2> /dev/null | grep -e "^ii" > /dev/null 2>&1 ; then - echo "" >> $_log_file - echo "## - Installing Debian Package \"$_debian_pkg\" .." >> $_log_file - echo "## -" >> $_log_file - echo "## - See ${_logdir}/debian-install.log for details" >> $_log_file - echo "## -" >> $_log_file - echo "apt-get install -q -y $_debian_pkg >> ${_logdir}/debian-install.log 2>&1" >> $_log_file - - echo "" >> ${_logdir}/debian-install.log - echo "## - Install $_debian_pkg" >> ${_logdir}/debian-install.log - - apt-get install -q -y $_debian_pkg >> ${_logdir}/debian-install.log 2>&1 - if [ "$?" = 0 ]; then - echo_ok - else - echo_failed - fatal "Installing debian package \"$_debian_pkg\" failed! \n - See '${_logdir}/debian-install.log' for further informations." - fi - else - echo_skipped - fi - - done - - ## - Install required/optional perl modules - ## - - - declare -a cpan_modules_arr - for _module in $_needed_cpan_modules ; do - cpan_modules_arr+=("$_module") - done - > ${_logdir}/cp_modul-install.log - - echo "" - echo -e "\tInstalling cpan modules .." - - for _cpan_module in ${cpan_modules_arr[@]} ; do - - echononl "\t Installing $_cpan_module .." - cpanm -q --skip-installed $_module > "${_logdir}/cp_modul-install.log" 2>&1 - if [[ "$?" -ne 0 ]] ; then - echo_failed - error "$(cat "${_logdir}/cp_modul-install.log")" - else - echo_ok - fi - - done - - info "After Installation finished, check presens of required perl modules" - - ## - Generate some locales - ## - echononl "\tConfigure locales used by the system (/etc/locale.gen)" - echo "" >> $_log_file - echo "## - Configure locales used by the system (/etc/locale.gen) ..." >> $_log_file - echo "## -" >> $_log_file - cat <> $_log_file -cat < /etc/locale.gen -bg_BG CP1251 -cs_CZ ISO-8859-2 -de_DE.UTF-8 UTF-8 -de_DE ISO-8859-1 -el_GR ISO-8859-7 -en_US.UTF-8 UTF-8 -en_US ISO-8859-1 -es_ES ISO-8859-1 -et_EE ISO-8859-1 -eu_ES ISO-8859-1 -fi_FI ISO-8859-1 -fr_FR ISO-8859-1 -hu_HU ISO-8859-2 -it_IT ISO-8859-1 -ja_JP.EUC-JP EUC-JP -nb_NO ISO-8859-1 -nl_NL ISO-8859-1 -oc_FR ISO-8859-1 -pl_PL ISO-8859-2 -pt_BR ISO-8859-1 -pt_PT ISO-8859-1 -ro_RO ISO-8859-2 -ru_RU ISO-8859-5 -sv_SE ISO-8859-1 -tr_TR ISO-8859-9 -zh_TW BIG5 -zh_CN GB2312 -END -EOF - cat < /etc/locale.gen -bg_BG CP1251 -cs_CZ ISO-8859-2 -de_DE.UTF-8 UTF-8 -de_DE ISO-8859-1 -el_GR ISO-8859-7 -en_US.UTF-8 UTF-8 -en_US ISO-8859-1 -es_ES ISO-8859-1 -et_EE ISO-8859-1 -eu_ES ISO-8859-1 -fi_FI ISO-8859-1 -fr_FR ISO-8859-1 -hu_HU ISO-8859-2 -it_IT ISO-8859-1 -ja_JP.EUC-JP EUC-JP -nb_NO ISO-8859-1 -nl_NL ISO-8859-1 -oc_FR ISO-8859-1 -pl_PL ISO-8859-2 -pt_BR ISO-8859-1 -pt_PT ISO-8859-1 -ro_RO ISO-8859-2 -ru_RU ISO-8859-5 -sv_SE ISO-8859-1 -tr_TR ISO-8859-9 -zh_TW BIG5 -zh_CN GB2312 -EOF - if [ "$?" = 0 ]; then - echo_ok - else - echo_failed - error "Setting locales definition in file \"/etc/locale.gen\" failed!" - fi - - - echononl "\tGenerating locales from /etc/locale.gen" - echo "" >> $_log_file - echo "## - Generating locales from /etc/locale.gen .." >> $_log_file - echo "## -" >> $_log_file - echo "locale-gen" >> $_log_file - locale-gen >> $_log_file 2>&1 - if [ "$?" = 0 ]; then - echo_ok - else - echo_failed - error "Generating locales from \"/etc/locale.gen\" failed! \n - See '${_logdir}/debian-install.log' for further informations." - fi - - echononl "\tAdd Environment Variable \"PERL5LIB\" to /etc/profile .." - if ! grep PERL5LIB /etc/profile > /dev/null 2>&1 ; then - echo "" >> $_log_file - echo "## - Add Environment Variable \"PERL5LIB\" to /etc/profile .." >> $_log_file - echo "## -" >> $_log_file - echo "echo \"export PERL5LIB=/usr/share/mhonarc\" >> /etc/profile" >> $_log_file - echo "export PERL5LIB=/usr/share/mhonarc" >> /etc/profile 2>> $_log_file - if [ "$?" = 0 ]; then - echo_ok - else - echo_failed - error "Adding Environment Variable \"PERL5LIB\" to /etc/profile failed! \n - See '${_logdir}/debian-install.log' for further informations." - fi - else - echo_skipped - fi - - ## - Make PERL5LIB also present in that shell - ## - - export PERL5LIB=/usr/share/mhonarc - else @@ -2184,7 +2219,7 @@ else ## - Stop Sympa list manager ## - echononl "\tStopping Sympa mailing list manager .." - if ps -e f | grep -E "${SYMPA_BASE_PATH}/s?bin/sympa" 2>/dev/null | grep -v grep > /dev/null 2>&1 ; then + if ps -e f | grep -E "${SYMPA_BASE_PATH}/s?bin/sympa" 2>/dev/null | grep -v grep > /dev/null 2>&1 ; then echo "" >> $_log_file echo "## - Stopping Sympa mailing list manager .." >> $_log_file echo "## -" >> $_log_file @@ -2226,7 +2261,7 @@ else ## - Stop Sympa's wwsympa.fcgi processes ## - echononl "\tStopping Sympa's wwsympa.fcgi processes .." - if ps -e f | grep -E "${SYMPA_BASE_PATH}/s?bin/wwsympa.fcgi" 2>/dev/null | grep -v grep > /dev/null 2>&1 ; then + if ps -e f | grep -E "${SYMPA_BASE_PATH}/s?bin/wwsympa.fcgi" 2>/dev/null | grep -v grep > /dev/null 2>&1 ; then echo "" >> $_log_file echo "## - Stopping Sympa's wwsympa.fcgi processes.." >> $_log_file echo "## -" >> $_log_file @@ -2317,7 +2352,7 @@ else [[ "$_proceed" == "YES" ]] || fatal "Exiting by user request.." fi fi - + # - Copy (hardlink) old Installation directory into tne new one # - echo -e "\tCopy (hardlink) '${CURRENT_INSTALL_DIR}' to directory" @@ -2356,7 +2391,7 @@ else ## --- Handle Sympa's List Data Directory ## --- - if [[ "$CURRENT_SYMPA_LIST_DATA_BASE_PATH" = "$SYMPA_LIST_DATA_BASE_SYMLINK" ]]; then + if [[ "$CURRENT_SYMPA_LIST_DATA_BASE_PATH" = "$SYMPA_LIST_DATA_BASE_SYMLINK" ]]; then echo -e "\tMove current data base directory ($CURRENT_SYMPA_LIST_DATA_BASE_PATH) to directory" echononl "\t '${CURRENT_SYMPA_LIST_DATA_BASE_PATH}-${SYMPA_OLD_VERSION}' .." echo "## - Move current data base directory ($CURRENT_SYMPA_LIST_DATA_BASE_PATH) to directory" >> $_log_file @@ -2614,7 +2649,7 @@ else fi -echo +echo echo -e "\t---" echo -e "\t--- Installation of Sympa mailing list server (${SYMPA_VERSION})" echo -e "\t---" @@ -2728,10 +2763,10 @@ else fi config_params="$config_params --with-confdir=$SYMPA_MAIN_CONF_DIR - --with-expldir=$SYMPA_LIST_DATA_DIR + --with-expldir=$SYMPA_LIST_DATA_DIR --with-aliases_file=$SYMPA_ALIAS_FILE - --with-user=$SYMPA_USER - --with-group=$SYMPA_GROUP" + --with-user=$SYMPA_USER + --with-group=$SYMPA_GROUP" cat << EOF >> $_log_file @@ -2904,7 +2939,7 @@ else error "Directory '$SYMPA_LIST_ARC_PATH' for list archives does not exists, but sympa is configured to use this directory - Maybe your list archive dir is located at '/usr/local/sympa-${SYMPA_OLD_VERSION}/arc' and you + Maybe your list archive dir is located at '/usr/local/sympa-${SYMPA_OLD_VERSION}/arc' and you have to move it to '$SYMPA_LIST_ARC_PATH'" echononl "continue anyway [yes/no]: " @@ -3088,7 +3123,7 @@ else fi -# - +# - # - Create Symlink $SYMPA_BASE_PATH --> $SYMPA_INSTALL_DIR @@ -3478,14 +3513,14 @@ else echo "cat << EOF > ${SYMPA_MAIN_CONF_DIR}/sympa.conf ## merge_feature -## Customizing messages. If set to 'on', allows the subscribers to send messages with custom users +## Customizing messages. If set to 'on', allows the subscribers to send messages with custom users ## attributes. It also allows the use of sympa variables in message templates, i.e. in message.footer merge_feature on EOF" >> $_log_file cat << EOF >> ${SYMPA_MAIN_CONF_DIR}/sympa.conf 2>> $_log_file ## merge_feature -## Customizing messages. If set to 'on', allows the subscribers to send messages with custom users +## Customizing messages. If set to 'on', allows the subscribers to send messages with custom users ## attributes. It also allows the use of sympa variables in message templates, i.e. in message.footer merge_feature on EOF @@ -3505,7 +3540,7 @@ EOF ### password_hash ### -### Information of users are stored in database table user_table. This parameter specifies a +### Information of users are stored in database table user_table. This parameter specifies a ### method to generate password hash. Currently these values are possible: ### md5 Uses MD5 digest algorithm. ### bcrypt Uses bcrypt hash function. @@ -3515,7 +3550,7 @@ EOF" >> $_log_file ### password_hash ### -### Information of users are stored in database table user_table. This parameter specifies a +### Information of users are stored in database table user_table. This parameter specifies a ### method to generate password hash. Currently these values are possible: ### md5 Uses MD5 digest algorithm. ### bcrypt Uses bcrypt hash function. @@ -3539,7 +3574,7 @@ EOF ## ## Fix to prevent 'yahoo' and other to reject mails from sympa mailing list manager. ## -## See also: +## See also: ## https://sympa-community.github.io/manual/customize/dmarc-protection.html dmarc_protection_mode dmarc_reject EOF" >> $_log_file @@ -3549,7 +3584,7 @@ EOF" >> $_log_file ## ## Fix to prevent 'yahoo' and other to reject mails from sympa mailing list manager. ## -## See also: +## See also: ## https://sympa-community.github.io/manual/customize/dmarc-protection.html dmarc_protection_mode dmarc_reject EOF @@ -3618,7 +3653,7 @@ personalization_feature on personalization.web_apply_on footer personalization.mail_apply_on footer -# allow_account_deletion: EXPERIMENTAL! +# allow_account_deletion: EXPERIMENTAL! # # Allow users to delete their account. If enabled, shows a "delete my account" form # in user's preferences page. @@ -3648,7 +3683,7 @@ personalization_feature on personalization.web_apply_on footer personalization.mail_apply_on footer -# allow_account_deletion: EXPERIMENTAL! +# allow_account_deletion: EXPERIMENTAL! # # Allow users to delete their account. If enabled, shows a "delete my account" form # in user's preferences page. @@ -3705,7 +3740,7 @@ else echo "" fi -echo +echo echo -e "\t---" echo -e "\t--- Some after installation tasks" echo -e "\t---" @@ -3730,7 +3765,7 @@ if [[ -f "${SYMPA_INIT_DIR}/sympa" ]] ; then echononl "\tAdd Block for run-time dependencies to ${SYMPA_INIT_DIR}/sympa .." echo "cp ${SYMPA_INIT_DIR}/sympa $_backup_sympa_initscript" >> $_log_file - cp ${SYMPA_INIT_DIR}/sympa $_backup_sympa_initscript >> $_log_file 2>&1 + cp ${SYMPA_INIT_DIR}/sympa $_backup_sympa_initscript >> $_log_file 2>&1 if [ "$?" != "0" ]; then _failed=true fi @@ -3871,6 +3906,53 @@ if $START_AT_BOOTTIME ; then See '${_log_file}' for further informations." fi fi # if $SYSTEMD_SUPPORTED + + if [[ "$os_dist" = "debian" ]] && [[ $os_version -gt 12 ]] ; then + + echononl "\tGive special approval for postfix to write into path '/usr/local/sympa'.." + echo "" >> $_log_file + echo "## - Give special approval for postfix to write into path '/usr/local/sympa'.." >> $_log_file + echo "## -" >> $_log_file + + _failed=false + if [[ ! -f /etc/systemd/system/postfix.service.d/override.conf ]]; then + + echo "mkdir \"/etc/systemd/system/postfix.service.d\"" >> $_log_file 2>&1 + mkdir "/etc/systemd/system/postfix.service.d" >> $_log_file 2>&1 + if [[ $? -gt 0 ]] ; then + _failed=true + fi + fi + + echo "cat <<'EOF' > /etc/systemd/system/postfix.service.d +[Service] +ReadWritePaths=/usr/local/sympa +EOF" >> $_log_file + cat <<'EOF' > /etc/systemd/system/postfix.service.d 2>> $_log_file +[Service] +ReadWritePaths=/usr/local/sympa +EOF + if [[ $? -gt 0 ]] ; then + _failed=true + fi + + if ${_failed}; then + echo_failed + error "Adding 'ReadWritePaths=/usr/local/sympa' to '/etc/systemd/system/postfix.service.d/override.conf' failed!\n + See '${_log_file}' for further informations." + + echononl " continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Abbruch durch User" + fi + + fi + fi # if START_AT_BOOTTIME @@ -3941,7 +4023,7 @@ if [ -f /etc/profile ]; then fi -echo +echo echo -e "\t---" echo -e "\t--- Configure Apache Webserver" echo -e "\t---" @@ -4206,7 +4288,7 @@ if $apache_vhost_added ; then fi fi -echo +echo echo -e "\t---" echo -e "\t--- Configure Postfix for Sympa Support" echo -e "\t---" @@ -4747,7 +4829,7 @@ EOF fi #fi - + fi @@ -4779,7 +4861,7 @@ EOF fi fi fi - + ## - Start Sympa mailing list manager ## -