From d6b1827fc33d83652530ccb085566be6b8fe0cd8 Mon Sep 17 00:00:00 2001 From: Christoph Date: Sun, 19 Feb 2017 12:58:15 +0100 Subject: [PATCH] Initial import --- .gitignore | 4 + DOC/sympa_aliases | 15 + DOC/sympa_postfix_main.cf | 23 + DOC/sympa_postfix_master.cf | 4 + DOC/sympa_postfix_transport_regexp | 2 + README.error-messages | 5 + README.neue-liste | 27 + README.whitelist | 129 + install_sympa.sh | 3496 ++++++++++++++++++++++++++++ oopen-logo_weiss.png | Bin 0 -> 4776 bytes oopen_favicon.ico | Bin 0 -> 1406 bytes 11 files changed, 3705 insertions(+) create mode 100644 .gitignore create mode 100644 DOC/sympa_aliases create mode 100644 DOC/sympa_postfix_main.cf create mode 100644 DOC/sympa_postfix_master.cf create mode 100644 DOC/sympa_postfix_transport_regexp create mode 100644 README.error-messages create mode 100644 README.neue-liste create mode 100644 README.whitelist create mode 100755 install_sympa.sh create mode 100644 oopen-logo_weiss.png create mode 100644 oopen_favicon.ico diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..afafe02 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +/BAK/* +/log_* +/sympa* +/whitelist* diff --git a/DOC/sympa_aliases b/DOC/sympa_aliases new file mode 100644 index 0000000..ea433c9 --- /dev/null +++ b/DOC/sympa_aliases @@ -0,0 +1,15 @@ +sympa: “| /home/sympa/bin/queue sympa@sympa.oopen.de” +listmaster: “| /home/sympa/bin/queue listmaster@sympa.oopen.de” +bounce+*: “| /home/sympa/bin/bouncequeue sympa@sympa.oopen.de” +abuse-feedback-report: “| /home/sympa/bin/bouncequeue sympa@sympa.oopen.de” +sympa-request: postmaster@sympa.oopen.de +sympa-owner: postmaster@sympa.oopen.de + +# And for each list, lines will be added like these: +#—————————— sympalist1: list alias created 19 Jan 2008 +sympalist1: “| /home/sympa/bin/queue sympalist1@sympa.oopen.de” +sympalist1-request: “| /home/sympa/bin/queue sympalist1-request@sympa.oopen.de” +sympalist1-editor: “| /home/sympa/bin/queue sympalist1-editor@sympa.oopen.de” +#sympalist1-subscribe: “| /home/sympa/bin/queue sympalist1-subscribe@sympa.oopen.de” +sympalist1-unsubscribe: “| /home/sympa/bin/queue sympalist1-unsubscribe@sympa.oopen.de” +sympalist1-owner: “| /home/sympa/bin/bouncequeue sympa_list1@sympa.oopen.de” diff --git a/DOC/sympa_postfix_main.cf b/DOC/sympa_postfix_main.cf new file mode 100644 index 0000000..7b8d396 --- /dev/null +++ b/DOC/sympa_postfix_main.cf @@ -0,0 +1,23 @@ +alias_maps = + hash:/etc/aliases + hash:/home/sympa/etc/sympa_aliases + +relay_domains = + $mydestination + lists.mydomain.tld +sympa_destination_recipient_limit = 1 +sympabounce_destination_recipient_limit = 1 + +recipient_delimiter = + + +## - virtual_alias_maps +## - +## - Note: virtual_alias_maps is needed only if you need to translate one list/servername to another +## - servername, such as using a relay server, which also requires the option relayhost=[servername]. +## - See footnote ([1.]) at bottom. +## - +virtual_alias_maps = + regexp:/home/sympa/etc/virtual.regexp + +transport_maps = + regexp:/home/sympa/etc/transport_regexp diff --git a/DOC/sympa_postfix_master.cf b/DOC/sympa_postfix_master.cf new file mode 100644 index 0000000..21cf5b4 --- /dev/null +++ b/DOC/sympa_postfix_master.cf @@ -0,0 +1,4 @@ +sympa unix - n n - - + pipe flags=R user=sympa argv=/home/sympa/bin/queue ${recipient} +sympabounce unix - n n - - pipe + flags=R user=sympa argv=/home/sympa/bin/bouncequeue ${recipient} diff --git a/DOC/sympa_postfix_transport_regexp b/DOC/sympa_postfix_transport_regexp new file mode 100644 index 0000000..c1593e2 --- /dev/null +++ b/DOC/sympa_postfix_transport_regexp @@ -0,0 +1,2 @@ +/^.-owner\@lists.mydomain.tld$/ sympabounce: +/^.\@lists.mydomain.tld$/ sympa: diff --git a/README.error-messages b/README.error-messages new file mode 100644 index 0000000..a8ce258 --- /dev/null +++ b/README.error-messages @@ -0,0 +1,5 @@ + + +Your message cannot be personalized. Please check template syntax. +Ihre Nachricht kann nicht personalisiert werden. Bitte überprüfen Sie die Syntax der Vorlage. + diff --git a/README.neue-liste b/README.neue-liste new file mode 100644 index 0000000..cda0f5d --- /dev/null +++ b/README.neue-liste @@ -0,0 +1,27 @@ +## - Sprache der Liste ändern: +## - +## - 1.) Menü links: Administrator +## - 2.) Menüleiste im Body: Listenkonfiguration berarbeiten --> Listendefinition +## - 3.) weiter unten: "Sprache der Liste (lang)" + + +## - Nachrichtenfuß (Message footer) hinzufügen +## - +## - 1.) Menü links: Administrator +## - 2.) Menüleiste im Body: Listenkonfiguration berarbeiten --> Nachrichtenvorlagen +## - 3.) Auf bearbeiten neben Nachrichtenfuß klicken +## - +## - 4.) gewünschten Text in das Bearbeotungsfeld einfügen +## - +## - Bemerkung: +## - Ist in der Haupt-Konfigurationsdatei der Parameter "merge_feature" auf "on" +## - (Vorgabewert ist: off), dann können Sympa Variablen benutz werden. +## - +## - Dieser Parameter kann auch spezifisch für eine Liste eingestellt werden: +## - +## - Administrator --> Listenkonfiguration berarbeiten --> Einstellungen zum Senden/Empfangen +## - +## - Ein Hinweis, wie sich ein Abonnent von der Liste abmelden kann, könnte dann so aussehen: +## - Um diese Liste abzubestellen, klicke hier: +## - [% wwsympa_url %]/auto_signoff/[% listname %]/[% user.escaped_email %] + diff --git a/README.whitelist b/README.whitelist new file mode 100644 index 0000000..c9f77cb --- /dev/null +++ b/README.whitelist @@ -0,0 +1,129 @@ +## - Sympa -- Integrate modlist/whitelist plugin +## - +## - See: +## - http://www.steveshipway.org/software/f_sympa.html +## - + +## - !! Notice !! +## - +## - For me in my installation modlist does not work (or i haven't unsertand +## - the use of modlist + +VERSION=1.1 +SYMPA_USER="sympa" +SYMPA_GROUP="sympa" +SYMPA_HOME=`realpath $(eval echo ~$SYMPA_USER)` + +## - Download file whitelist-1.1.tar +## - +cd /usr/local/src/sympa/ +wget http://www.steveshipway.org/software/sympa/whitelist-${VERSION}.tar + +tar -xf whitelist-${VERSION}.tar + +## --- +## - Copy the plugin-files to their appropriate targets +## --- +cd whitelist-${VERSION} + + +## - 1. Copy whitelist.pm and modlist.pm to the custom_actions directory. +## - These are the custom actions. If you only copy the whitelist.pm then +## - modlist functionality will be disabled. Either put them at the top level, +## - or at robot level as you prefer. +## - +cp -a custom_actions/whitelist.pm ${SYMPA_HOME}/etc/custom_actions/ +#cp -a modlist.pm ${SYMPA_HOME}/etc/custom_actions/ +chown -R ${SYMPA_USER}:$SYMPA_GROUP ${SYMPA_HOME}/etc/custom_actions + + +## - 2. Create default empty whitelist.txt and modlist.txt files in +## - search_filters (or wherever your Sympa search_filters path is). +## - These must exist as a default for lists that do not have a defined whitelist +## - or modlist. +## - +touch ${SYMPA_HOME}/etc/search_filters/whitelist.txt +touch ${SYMPA_HOME}/etc/search_filters/modlist.txt +chown -R ${SYMPA_USER}:$SYMPA_GROUP ${SYMPA_HOME}/etc/search_filters + + +## - 3. Install the whitelist.tt2 template into the web_tt2 directory. +## - This is the admin pages for the whitelist and modlist. It goes into +## - your web_tt2 customisation directory. +## - +cp -a web_tt2/whitelist.tt2 ${SYMPA_HOME}/etc/web_tt2/ +chown ${SYMPA_USER}:$SYMPA_GROUP ${SYMPA_HOME}/etc/web_tt2/whitelist.tt2 + + +## - 4. Update nav.tt2 on your system. This is where you add the new Whitelist +## - and Modlist menu items. The supplied nav.tt2 file +## - should work with Sympa 6.2.x but if you have already customised nav.tt2 +## - you should make sure to add the necessary Whitelist and Modlist parts. +## - +cp -a web_tt2/nav.tt2 ${SYMPA_HOME}/etc/web_tt2/ + +## - If you only instlled whitelist functionality, you can comment in the +## - entry for modlist +## - +## - line 146, change to +## - +## - +cp -a ${SYMPA_HOME}/etc/web_tt2/nav.tt2 ${SYMPA_HOME}/etc/web_tt2/nav.tt2.ORIG +vim ${SYMPA_HOME}/etc/web_tt2/nav.tt2 + + +## - 5. Update search.tt2 and review.tt2. These add the Whitelist and Modlist +## - buttons to the subscribers review page. The supplied files +## - should work with Sympa 6.2.x but if you have already customised them +## - you should make sure to add the necessary Whitelist and Modlist parts. +## - +cp -a web_tt2/{search.tt2,review.tt2} ${SYMPA_HOME}/etc/web_tt2/ + +## - If you only instlled whitelist functionality, you can comment in the +## - entries for modlist +## - +## - search.tt2 line 12, change to +## - +## - +## - review.tt2 line 12, change to +## - +## - +cp -a ${SYMPA_HOME}/etc/web_tt2/search.tt2 ${SYMPA_HOME}/etc/web_tt2/search.tt2.ORIG +vim ${SYMPA_HOME}/etc/web_tt2/search.tt2 + +cp -a ${SYMPA_HOME}/etc/web_tt2/review.tt2 ${SYMPA_HOME}/etc/web_tt2/review.tt2.ORIG +vim ${SYMPA_HOME}/etc/web_tt2/review.tt2 + + +## - 6. Update admin.t22. This adds the white/modlist options to the list admin +## - page. This is optional but recommended. +## - +cp -a web_tt2/admin.tt2 ${SYMPA_HOME}/etc/web_tt2/ + +## - If you only instlled whitelist functionality, you can comment in the +## - entry for modlist +## - +## - line 15, change to +## - +## - +cp -a ${SYMPA_HOME}/etc/web_tt2/admin.tt2 ${SYMPA_HOME}/etc/web_tt2/admin.tt2.ORIG +vim ${SYMPA_HOME}/etc/web_tt2/admin.tt2 + +chown -R ${SYMPA_USER}:$SYMPA_GROUP ${SYMPA_HOME}/etc/web_tt2 + + +## -7. Copy include.send.header into your scenari directory. This +## - activates the Whitelist and Modlist on all lists, though until you define +## - some entries, all lists will get the default empty files you set up in +## - step 2. +## - +cp scenari/include.send.header ${SYMPA_HOME}/etc/scenari/ +chown -R ${SYMPA_USER}:$SYMPA_GROUP ${SYMPA_HOME}/etc/scenari + + +## - 8. Restart the Sympa daemons, and restart your web server. This will pick up +## - the changes. +## - +/etc/init.d/sympa restart +systemctl restart sympa + diff --git a/install_sympa.sh b/install_sympa.sh new file mode 100755 index 0000000..36b8513 --- /dev/null +++ b/install_sympa.sh @@ -0,0 +1,3496 @@ +#!/usr/bin/env bash + +## - Pre-defined Parameters +## - +_VSERVER_GUEST=no + +_SYMPA_VERSION=6.2.15 + +_SYMPA_USER=sympa + +#_PREFIX=/home/sympa +_PREFIX=/usr/local/sympa + +_SYMPA_LIST_DATA_DIR=/data/sympa/list_data +_SYMPA_MAIN_CONF_DIR=/etc/sympa + +_START_AT_BOOTTIME=yes +_SYMLINK_INSTALL_DIR=no + +_SYMPA_DOMAIN=sympa.oopen.de +_SYMPA_LISTMASTER=support@oopen.de +_SYMPA_DB_TYPE=mysql +_SYMPA_DB_HOST=127.0.0.1 +## - +## - End: pre-defined Parameters + +_srcdir=/usr/local/src/sympa + +_required_debian_packages=" + libauthcas-perl + libclass-singleton-perl + libdatetime-timezone-perl + libdatetime-format-mail-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-ciphersaber-perl + libcrypt-openssl-x509-perl + libcrypt-smime-perl + libdata-password-perl + libproc-processtable-perl + libdbi-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 + libcrypt-ciphersaber-perl + libmail-dkim-perl + " +#_required_debian_packages=" +# libcgi-pm-perl +# libdbd-mysql-perl +# mhonarc" + + + +## --- some functions +## --- +echononl(){ + echo X\\c > /tmp/shprompt$$ + if [ `wc -c /tmp/shprompt$$ | awk '{print $1}'` -eq 1 ]; then + echo -e -n "$*\\c" 1>&2 + else + echo -e -n "$*" 1>&2 + fi + rm /tmp/shprompt$$ +} + +fatal(){ + echo "" + echo -e "[ \033[31m\033[1mError\033[m ]: $*" + echo "" + echo -e "\t\033[31m\033[1mInstalllation is canceled\033[m\033[m" + echo "" + exit 1 +} + +warn (){ + echo "" + echo -e "\t[ \033[33m\033[1mWarning\033[m ]: $*" + echo "" +} + +info (){ + echo "" + echo -e "\t[ \033[33m\033[1mInfo\033[m ]: $*" + echo "" +} + +ok (){ + echo "" + echo -e "\t[ \033[36m\033[1mOk\033[m ]: $*" + echo "" +} + +error(){ + echo "" + echo -e "\t[ \033[31m\033[1mFehler\033[m ]: $*" + echo "" +} + +echo_ok() { + echo -e "\033[75G[ \033[32mok\033[m ]" +} +echo_failed(){ + echo -e "\033[75G[ \033[1;31mfailed\033[m ]" +} +echo_skipped() { + echo -e "\033[75G[ \033[33m\033[1mskipped\033[m ]" +} +## --- +## --- END: functions + + +APACHE_INIT_SCRIPT="" +if [ -x "/etc/init.d/apache2" ]; then + APACHE_INIT_SCRIPT="/etc/init.d/apache2" +elif [ -x "/etc/init.d/apachectl" ]; then + APACHE_INIT_SCRIPT="/etc/init.d/apachectl" +else + fatal 'Cannot find init-script for Apache web server!' +fi + +## - Determin the IP-Addresses +## - +__ipv4="`ifconfig | grep -e \"^\s*inet Adresse\" | grep -v \"127.0.0.1\" | awk '{print$2}' | cut -d\":\" -f2 | sort | head -1`" +__ipv6="`ifconfig | grep -e \"^\s*inet6-Adresse\" | awk '{print$2}' | grep -v -e \"^::1/\" | grep -v -e \"^fe80\" | cut -d\"/\" -f1 | sort | head -1`" + + +_debian_apache_installation=false +_base_webserver_info_needed=false +_apache_vhost_dir="" +apache_log_dir="" +apache_conf_dir="" +apache_vhost_dir="" +## - Determin VHost Configuration Directory +## - +if dpkg -l apache2 2> /dev/null | grep -e "^ii" > /dev/null 2>&1 ; then + + _debian_apache_installation=true + + if [ -d "/etc/apache2" -a -d "/etc/apache2/sites-available" ]; then + apache_vhost_dir=/etc/apache2/sites-available + apache_conf_dir=/etc/apache2 + if [ -d "/var/log/apache2" ]; then + apache_log_dir=/var/log/apache2 + else + error "Found Debian Apache Installation, but no Log Directory found!" + fatal "Something went wron with your Apache Installation" + fi + else + error "Found Debian Apache Installation, but no Configuration Directory for vhosts!" + fatal "Something went wron with your Apache Installation" + fi + +else + + ## - Determin httpd binary + ## - + _httpd_binary="`which httpd`" + if [ -z "$_httpd_binary" ]; then + _httpd_binary="`ps -C httpd -f | grep -e \"^root\" | awk '{print$8}'`" + if [ -z "$_httpd_binary" ]; then + if [ -x "/usr/local/apache2/bin/httpd" ]; then + _httpd_binary="/usr/local/apache2/bin/httpd" + fi + fi + fi + ## - Determin ServerRoot Directory + ## - + apache_base_dir_found=false + _pass_apache_base_dir=false + apache_base_dir=`$_httpd_binary -t -D DUMP_RUN_CFG | grep ServerRoot | awk '{print$2}' | tr -d '"'` + if [ "`realpath /usr/local/apache2`" = "$apache_base_dir" ]; then + apache_base_dir="/usr/local/apache2" + _apache_base_dir_realpath="`realpath $apache_base_dir`" + elif [ -z "$apache_base_dir" ]; then + if [ -d "`realpath /usr/local/apache2`" ];then + apache_base_dir="/usr/local/apache2" + _apache_base_dir_realpath="`realpath $apache_base_dir`" + fi + else + _apache_base_dir_realpath=$apache_base_dir + fi + if [ -z "$apache_base_dir" ];then + _base_webserver_info_needed=true + apache_base_dir_found=true + else + _pass_apache_base_dir=true + fi + + ## - Determin Apache Configuration Directory + ## - + apache_conf_dir_found=false + if [ -n "$apache_base_dir" ];then + if [ -d "${apache_base_dir}/conf" ]; then + apache_conf_dir=${apache_base_dir}/conf + apache_conf_dir_found=true + else + _base_webserver_info_needed=true + fi + else + _base_webserver_info_needed=true + fi + + ## - Determin Apache Log Directory + ## - + _apache_errorlog_dir=`$_httpd_binary -t -D DUMP_RUN_CFG | grep "Main ErrorLog:" | awk '{print$3}' | tr -d '"'` + if [ -d "`dirname $_apache_errorlog_dir`" ]; then + apache_log_dir=`dirname $_apache_errorlog_dir` + fi + + ## - Determin VHost Configuration Directory + ## - + if [ -d "${apache_conf_dir}/vhosts" ]; then + _apache_vhost_dir=${apache_conf_dir}/vhosts + fi +fi + +if $_base_webserver_info_needed ; then + fatal "Apache Webserver not found!" +fi + +clear +echo +echo -e "\033[21G\033[32mInstallation script for Sympa mailing list server \033[m" +echo +echo +echo + + +DISTRIBUTION= +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Which (linux) distribution is installed?" +echo "" +echo "[1] Debian" +echo "[2] andere" +echo "" +echononl "Eingabe: " + +while [ "$DISTRIBUTION" != "Debian" -a "$DISTRIBUTION" != "other" ];do + read OPTION + case $OPTION in + 1) DISTRIBUTION="Debian" + ;; + 2) DISTRIBUTION="other" + ;; + *) echo "" + echo -e "\tFalsche Eingabe ! [ 1 = Debian ; 2 = andere ]" + echo "" + echononl "Eingabe:" + ;; + esac +done +if [ "$DISTRIBUTION" == "other" ]; then + info "Distributions other than Debian are not supported by that script." + echo -e "\n\t \033[31m\033[1mInstallation is canceled\033[m\033[m .." + echo "" + exit 2 +elif [ "$DISTRIBUTION" == "Debian" ]; then + SYMPA_INIT_DIR=/etc/init.d +else + SYMPA_INIT_DIR=/etc/rc.d/init.d +fi + +_UPDATE_SYMPA="" +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Are you going to update an existing Installation?" +echo "" +echo "[1] New initial Installation" +echo "[2] Update existing Installation" +echo "" +echononl "Eingabe: " + + +while [ "$_UPDATE_SYMPA" != "update" -a "$_UPDATE_SYMPA" != "new" ];do + read OPTION + case $OPTION in + 1) _UPDATE_SYMPA="new" + ;; + 2) _UPDATE_SYMPA="update" + ;; + *) echo "" + echo -e "\tFalsche Eingabe ! [ 1 = Neuinstallation ; 2 = Update ]" + echo "" + echononl "Eingabe:" + ;; + esac +done +if [ "$_UPDATE_SYMPA" = "update" ];then + UPDATE_SYMPA=true +else + UPDATE_SYMPA=false +fi + + +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Insert version number for Sympa mailing list server." +echo "" +echo "" +SYMPA_VERSION= +echononl "Sympa version [$_SYMPA_VERSION]: " +read SYMPA_VERSION +if [ "X$SYMPA_VERSION" = "X" ]; then + SYMPA_VERSION=$_SYMPA_VERSION +fi +_builddir=${_srcdir}/sympa-$SYMPA_VERSION +_logdir=${_srcdir}/log_sympa-$SYMPA_VERSION +if $UPDATE_SYMPA ; then + _log_file=${_logdir}/sympa_update.log +else + _log_file=${_logdir}/sympa_install.log +fi + + +if ! $UPDATE_SYMPA ; then + + SYMPA_SUPPORT_MULTIDOMAINS=true + echo "" + echo "--" + echo "" + echo "Should Sympa support multidomains?" + echo "" + OK="" + echononl "Support Multidomains? (yes/no) [yes]: " + read OK + if [ "X$OK" = "X" ]; then + OK=yes + fi + while [ "X$OK" != "Xyes" -a "X$OK" != "XYes" -a "X$OK" != "XNo" -a "X$OK" != "Xno" ]; do + echo "" + echononl "\twrong entry! [yes/no]: " + read OK + done + [ $OK = "Yes" -o $OK = "yes" ] || SYMPA_SUPPORT_MULTIDOMAINS=false + + + POSTFIX_CONF_DIR= + POSTFIX_CONF_FILES_FOUND=false + if [ "$DISTRIBUTION" = "Debian" ]; then + if dpkg -l postfix | grep -q -e "^ii" 2> /dev/null ; then + if [ -f "/etc/postfix/main.cf" -a -f "/etc/postfix/master.cf" ]; then + POSTFIX_CONF_DIR=/etc/postfix + POSTFIX_CONF_FILES_FOUND=true + fi + fi + fi + + if ! $POSTFIX_CONF_FILES_FOUND ; then + info "Only Postfix is suported by this installation script." + echo "" + echo "--" + echo "" + echo "Specify Directory includes postfix files \"main.cf\" and \"master.cf\"." + echo "" + echo " Type \"^C\" to abort if postfix isn't installed on this system." + while [ "X$POSTFIX_CONF_DIR" = "X" ]; do + echo "" + echononl "Postfix Config Directory: " + read POSTFIX_CONF_DIR + if [ "X$POSTFIX_CONF_DIR" = "X" ]; then + echo "" + echo -e "\t\033[33mDeclaration is mandatory!\033[m" + else + if [ ! -f "${POSTFIX_CONF_DIR}/main.cf" -a ! -f "${POSTFIX_CONF_DIR}/master.cf" ]; then + echo "" + echo -e "\t\033[33mPostfix confuguration not found at that location!\033[m retry.." + POSTFIX_CONF_DIR="" + fi + fi + done + fi + + + echo "" + echo "--" + echo "" + echo "Specify Sympa's user and group." + echo "" + SYMPA_USER= + while [ "X$SYMPA_USER" = "X" ] + do + echononl "Sympa user [${_SYMPA_USER}]: " + read SYMPA_USER + if [ "X$SYMPA_USER" = "X" ]; then + SYMPA_USER=$_SYMPA_USER + fi + done + SYMPA_GROUP= + while [ "X$SYMPA_GROUP" = "X" ] + do + echononl "Sympa group [$SYMPA_USER]: " + read SYMPA_GROUP + if [ "X$SYMPA_GROUP" = "X" ]; then + SYMPA_GROUP=$SYMPA_USER + fi + done +fi + +echo "" +echo "--" +echo "" +echo "Specify Sympa's installation directory." +echo "" +PREFIX= +echononl "Sympa installation directory [${_PREFIX}]: " +read PREFIX +if [ "X$PREFIX" = "X" ]; then + PREFIX=$_PREFIX +fi +SYMPA_MANPATH=${PREFIX}/share/man +SYMPA_BIN_DIR=${PREFIX}/bin + +if $UPDATE_SYMPA ; then + if [ ! -f "${PREFIX}/bin/sympa.pl" ]; then + fatal "You are in update mode, but i can't find existing installation at $PREFIX" + fi + SYMPA_USER=`stat -c "%U" $PREFIX` + SYMPA_GROUP=`stat -c "%G" $PREFIX` +fi + +SYMPA_OLD_VERSION="" +if $UPDATE_SYMPA ; then + SYMPA_OLD_VERSION=`egrep -v '^s*$|^#' ${PREFIX}/etc/data_structure.version 2> /dev/null | head -1` + if [ -n "$SYMPA_OLD_VERSION" -a "$SYMPA_OLD_VERSION" == "$SYMPA_VERSION" ]; then + warn "You are in update mode, but the old version ($SYMPA_OLD_VERSION) is the same as the new one ($SYMPA_VERSION)!" + echononl "Type uppercase \"yes\" to proceed with upgrading: " + + read _proceed + [[ "$_proceed" == "YES" ]] || fatal "Exiting by user request.." + fi +fi + +echo "" +echo "--" +echo "" +echo "Specify directory of Sympa main configuration file (sympa.conf)." +echo "" +SYMPA_MAIN_CONF_DIR=$_SYMPA_MAIN_CONF_DIR +echononl "Sympa main configuration directory [${_SYMPA_MAIN_CONF_DIR}]: " +read SYMPA_MAIN_CONF_DIR +if [ "X$SYMPA_MAIN_CONF_DIR" = "X" ]; then + SYMPA_MAIN_CONF_DIR=$_SYMPA_MAIN_CONF_DIR +fi + +if $UPDATE_SYMPA ; then + if [ ! -f "${SYMPA_MAIN_CONF_DIR}/sympa.conf" ]; then + fatal "You are in update mode, but i can't find existing main configuration at $SYMPA_MAIN_CONF_DIR" + fi +else + if [ -s "${SYMPA_MAIN_CONF_DIR}/sympa.conf" ]; then + warn "File \"${SYMPA_MAIN_CONF_DIR}/sympa.conf\" is not empty, but this is an initial installation!" + _empty_conf_file="" + echononl "Backup and then delete ${SYMPA_MAIN_CONF_DIR}/sympa.conf now? (yes/no) [yes]: " + read _empty_conf_file + if [ "X$_empty_conf_file" = "X" ]; then + _empty_conf_file=yes + fi + while [ "X$_empty_conf_file" != "Xyes" -a "X$_empty_conf_file" != "XYes" -a "X$_empty_conf_file" != "XNo" -a "X$_empty_conf_file" != "Xno" ]; do + echo "" + echononl "\twrong entry! [yes/no]: " + read OK + done + _empty_conf_file=`echo "$_empty_conf_file" | tr '[:upper:]' '[:lower:]'` + if [ "$_empty_conf_file" = "yes" ]; then + mv ${SYMPA_MAIN_CONF_DIR}/sympa.conf ${SYMPA_MAIN_CONF_DIR}/sympa.conf.`date +%Y%m%d-%H%M` + ok "Saved ${SYMPA_MAIN_CONF_DIR}/sympa.conf to ${SYMPA_MAIN_CONF_DIR}/sympa.conf.`date +%Y%m%d-%H%M`" + fi + fi +fi + +SYMPA_LIST_DATA_DIR= +if $UPDATE_SYMPA ; then + SYMPA_LIST_DATA_DIR=`grep -e "^home" ${SYMPA_MAIN_CONF_DIR}/sympa.conf | awk '{print$2}'` + if [ ! -d "$SYMPA_LIST_DATA_DIR" ]; then + echo "" + echo "--" + echo "" + echo "Specify Sympa's list data directory." + echo "" + SYMPA_LIST_DATA_DIR=$_SYMPA_LIST_DATA_DIR + echononl "Sympa's list data directory [${_SYMPA_LIST_DATA_DIR}]: " + read SYMPA_LIST_DATA_DIR + if [ "X$SYMPA_LIST_DATA_DIR" = "X" ]; then + SYMPA_LIST_DATA_DIR=$_SYMPA_LIST_DATA_DIR + fi + fi +else + echo "" + echo "--" + echo "" + echo "Specify Sympa's list data directory." + echo "" + SYMPA_LIST_DATA_DIR=$_SYMPA_LIST_DATA_DIR + echononl "Sympa's list data directory [${_SYMPA_LIST_DATA_DIR}]: " + read SYMPA_LIST_DATA_DIR + if [ "X$SYMPA_LIST_DATA_DIR" = "X" ]; then + SYMPA_LIST_DATA_DIR=$_SYMPA_LIST_DATA_DIR + fi +fi +if $UPDATE_SYMPA ; then + if [ ! -d "$SYMPA_LIST_DATA_DIR" ]; then + fatal "You are in update mode, but i can't find existing list data dir at $SYMPA_LIST_DATA_DIR" + fi +fi + + +## - Apache webserver related +## - + +if ! $UPDATE_SYMPA ; then + if ! $_debian_apache_installation ; then + echo "" + echo "" + echo -e "\033[32m-- Apache Webserver related\033[m" + echo "" + echo "Insert Directory where the vhost configuration file should stay.." + echo "" + apache_vhost_dir= + while [ "X$apache_vhost_dir" = "X" ] ; do + if [ -n "$_apache_vhost_dir" ];then + echononl "VHost Base Directory [$_apache_vhost_dir]: " + read apache_vhost_dir + if [ "X$apache_vhost_dir" = "X" ]; then + apache_vhost_dir=$_apache_vhost_dir + fi + else + echononl "VHost Base Directory: " + read apache_vhost_dir + if [ ! -d "$read apache_vhost_dir" ];then + echo -e "\n\t\033[1;33mDirectory \"${apache_vhost_dir}\" not found! Try again..\033[m\n" + apache_vhost_dir="" + fi + fi + done + + if [ -z "$apache_log_dir" ]; then + + echo "" + echo "" + echo -e "\033[32m--\033[m" + echo "" + echo "Insert Directory where the log files should stay.." + echo "" + while [ "X$apache_log_dir" = "X" ] ; do + echononl "Apache Log Directory: " + read apache_log_dir + if [ -z "$apache_log_dir" ]; then + echo -e "\n\t\033[1;33mDeclaration is mandatory!\033[m Try again..\n" + elif [ ! -d "$apache_log_dir" ];then + echo -e "\n\t\033[1;33mDirectory \"${apache_log_dir}\" not found!\033[m Try again..\n" + apache_log_dir="" + fi + done + fi + fi + + echo "" + echo "" + echo -e "\033[32m--\033[m" + echo "" + echo "Insert the IP-Addresses where the webserver should listen for that site." + echo "" + IPv4= + while [ "X$IPv4" = "X" ];do + if [ -z "$__ipv4" ]; then + echononl "IPv4 address: " + read IPv4 + if [ "X$IPv4" = "X" ]; then + echo -e "\n\t\033[33m\033[1mEingabe erforderlich!\033[m\n" + fi + else + echononl "IPv4 address [$__ipv4]: " + read IPv4 + if [ "X$IPv4" = "X" ]; then + IPv4=$__ipv4 + fi + fi + done + IPv6= + while [ "X$IPv6" = "X" ];do + if [ -z "$__ipv6" ]; then + echononl "IPv6 address: " + read IPv6 + if [ "X$IPv6" = "X" ]; then + echo -e "\n\t\033[33m\033[1mEingabe erforderlich!\033[m\n" + fi + else + echononl "IPv6 address [$__ipv6]: " + read IPv6 + if [ "X$IPv6" = "X" ]; then + IPv6=$__ipv6 + fi + fi + done +fi + + + + +SYMPA_ALIAS_FILE= +if $UPDATE_SYMPA ; then + if [ -f "/etc/postfix/sympa_aliases" ]; then + SYMPA_ALIAS_FILE=/etc/postfix/sympa_aliases + else + echo "--" + echo "" + echo "Set aliases file." + echo "" + echononl "Sympa aliases file: " + read SYMPA_ALIAS_FILE + while [ "X$SYMPA_ALIAS_FILE" = "X" ]; do + echo "" + echo -e "\tInput is required!" + echo "" + echononl "Sympa aliases file: " + read SYMPA_ALIAS_FILE + done + fi + if [ ! -f "$SYMPA_ALIAS_FILE" ]; then + fatal "You are in update mode, but i cannot find aliases file $SYMPA_ALIAS_FILE." + fi +else + echo "--" + echo "" + echo "Set aliases file." + echo "" + if [ -d "/etc/postfix" ]; then + _SYMPA_ALIAS_FILE=/etc/postfix/sympa_aliases + echononl "Sympa aliases file [$_SYMPA_ALIAS_FILE]: " + read SYMPA_ALIAS_FILE + if [ "X$SYMPA_ALIAS_FILE" == "X" ]; then + SYMPA_ALIAS_FILE=$_SYMPA_ALIAS_FILE + fi + else + echononl "Sympa aliases file: " + read SYMPA_ALIAS_FILE + while [ "X$SYMPA_ALIAS_FILE" = "X" ]; do + echo "" + echo -e "\tFalsche Eingabe ! [ 1 = Debian ; 2 = andere ]" + echo "" + echononl "Sympa aliases file: " + read SYMPA_ALIAS_FILE + done + fi + +fi + + + +if ! $UPDATE_SYMPA ; then + + echo "" + echo "" + echo -e "\033[32m--\033[m" + echo -e "\033[32m--\033[m Some parameters for server configuration" + echo -e "\033[32m--\033[m" + echo "" + echo "" + echo "Default domain for the mailing lists" + echo "" + SYMPA_DOMAIN= + echononl "domain [${_SYMPA_DOMAIN}]: " + read SYMPA_DOMAIN + if [ "X$SYMPA_DOMAIN" = "X" ]; then + SYMPA_DOMAIN=$_SYMPA_DOMAIN + fi + + echo "" + echo "" + echo "Listmaster" + echo " - Comma seperated list of email addresses" + echo "" + SYMPA_LISTMASTER= + echononl "listmaster [${_SYMPA_LISTMASTER}]: " + read SYMPA_LISTMASTER + if [ "X$SYMPA_LISTMASTER" = "X" ]; then + SYMPA_LISTMASTER=$_SYMPA_LISTMASTER + fi + + echo "" + echo "" + echo "URL for the Sympa web interface" + echo "" + SYMPA_WEB_URL= + _SYMPA_WEB_URL="https://$SYMPA_DOMAIN/wws" + echononl "wwsympa_url [${_SYMPA_WEB_URL}]: " + read SYMPA_WEB_URL + if [ "X$SYMPA_WEB_URL" = "X" ]; then + SYMPA_WEB_URL=$_SYMPA_WEB_URL + fi + + echo "" + echo "-- Database related Parameters" + echo "" + echo "Database management system" + echo "" + echo "[1] MySQL" + echo "[2] SQLite" + echo "[3] Postgres" + echo "[4] ORACLE" + echo "[5] Sybase" + echo "" + SYMPA_DB_TYPE="" + echononl "Eingabe: " + while [ "$SYMPA_DB_TYPE" != "mysql" \ + -a "$SYMPA_DB_TYPE" != "SQLite" \ + -a "$SYMPA_DB_TYPE" != "Pg" \ + -a "$SYMPA_DB_TYPE" != "Oracle" \ + -a "$SYMPA_DB_TYPE" != "Sybase" ]; do + read OPTION + case $OPTION in + 1) SYMPA_DB_TYPE="mysql" + ;; + 2) SYMPA_DB_TYPE="SQLite" + ;; + 3) SYMPA_DB_TYPE="Pg" + ;; + 4) SYMPA_DB_TYPE="Oracle" + ;; + 5) SYMPA_DB_TYPE="Sybase" + ;; + *) echo "" + echo -e "\tFalsche Eingabe ! [ 1 = MySQL | 2 = SQLite | 3 = Postgres | 4 = Oracle | 5 = Sybase ]" + echo "" + echononl "Eingabe:" + ;; + esac + done + + echo "" + echo "" + echo "Name of the database containing user information." + echo "" + echo "If you are using SQLite, then this parameter is the DB file name." + echo "" + SYMPA_DB_NAME= + while [ "X$SYMPA_DB_NAME" = "X" ]; do + echononl "db_name: " + read SYMPA_DB_NAME + if [ "X$SYMPA_DB_NAME" = "X" ]; then + echo "" + echo -e "\n\t\033[33m\033[1mEingabe erforderlich!\033[m\n" + continue + fi + done + + echo "" + echo "" + echo "Database host name." + echo "" + SYMPA_DB_HOST= + echononl "db_host [$_SYMPA_DB_HOST]: " + read SYMPA_DB_HOST + if [ "X$SYMPA_DB_HOST" == "X" ]; then + SYMPA_DB_HOST=$_SYMPA_DB_HOST + fi + + if [ "$SYMPA_DB_HOST" == "localhost" ]; then + SYMPA_DB_HOST=127.0.0.1 + fi + if [ "$SYMPA_DB_TYPE" == "mysql" ]; then + _SYMPA_DB_PORT=3306 + elif [ "$SYMPA_DB_TYPE" == "Pg" ]; then + _SYMPA_DB_PORT=5432 + elif [ "$SYMPA_DB_TYPE" == "Sybase" ]; then + _SYMPA_DB_PORT=2638 + elif [ "$SYMPA_DB_TYPE" == "Oracle" ]; then + _SYMPA_DB_PORT=1575 + fi + if [ "$SYMPA_DB_TYPE" != "SQLite" ]; then + echo "" + echo "" + echo "Database port." + echo "" + SYMPA_DB_PORT= + echononl "db_port [$_SYMPA_DB_PORT]: " + read SYMPA_DB_PORT + if [ "X$SYMPA_DB_PORT" == "X" ]; then + SYMPA_DB_PORT=$_SYMPA_DB_PORT + fi + fi + + echo "" + echo "" + echo "Database user." + echo "" + SYMPA_DB_USER= + while [ "X$SYMPA_DB_USER" = "X" ]; do + echononl "db_user: " + read SYMPA_DB_USER + if [ "X$SYMPA_DB_USER" = "X" ]; then + echo "" + echo -e "\n\t\033[33m\033[1mEingabe erforderlich!\033[m\n" + continue + fi + done + + echo "" + echo "" + echo "Password for database user." + echo "" + SYMPA_DB_PASSWD= + while [ "X$SYMPA_DB_PASSWD" = "X" ]; do + echononl "db_passwd: " + read SYMPA_DB_PASSWD + if [ "X$SYMPA_DB_PASSWD" = "X" ]; then + echo "" + echo -e "\n\t\033[33m\033[1mEingabe erforderlich!\033[m\n" + continue + fi + done + + +else + SYMPA_DOMAIN=`grep -e "^domain" ${SYMPA_MAIN_CONF_DIR}/sympa.conf | awk '{print$2}'` + SYMPA_LISTMASTER=`grep -e "^listmaster" ${SYMPA_MAIN_CONF_DIR}/sympa.conf | awk '{print$2}'` + SYMPA_WEB_URL=`grep -e "^wwsympa_url" ${SYMPA_MAIN_CONF_DIR}/sympa.conf | awk '{print$2}'` + SYMPA_DB_TYPE=`grep -e "^db_type" ${SYMPA_MAIN_CONF_DIR}/sympa.conf | awk '{print$2}'` + SYMPA_DB_NAME=`grep -e "^db_name" ${SYMPA_MAIN_CONF_DIR}/sympa.conf | awk '{print$2}'` + SYMPA_DB_HOST=`grep -e "^db_host" ${SYMPA_MAIN_CONF_DIR}/sympa.conf | awk '{print$2}'` + SYMPA_DB_PORT=`grep -e "^db_port" ${SYMPA_MAIN_CONF_DIR}/sympa.conf | awk '{print$2}'` + SYMPA_DB_USER=`grep -e "^db_user" ${SYMPA_MAIN_CONF_DIR}/sympa.conf | awk '{print$2}'` + SYMPA_DB_PASSWD=`grep -e "^db_passwd" ${SYMPA_MAIN_CONF_DIR}/sympa.conf | awk '{print$2}'` +fi + +_wwsympa_dir="$(echo $SYMPA_WEB_URL | grep / | cut -d/ -f4-)" + + +## - Test if NySQL connection is available +## - +if [ "$SYMPA_DB_TYPE" == "mysql" ]; then + mysql -h $SYMPA_DB_HOST -u $SYMPA_DB_USER -p"$SYMPA_DB_PASSWD" $SYMPA_DB_NAME -N -s -e "show databases" > /dev/null 2>&1 + if [ "$?" != "0" ]; then + if $UPDATE_SYMPA ; then + fatal "Cannot connect to database witg given credentials" + else + warn "Cannot connect to database. Try to create a new one with the given credentials" + if [ -f "/usr/local/mysql/sys-maint.cnf" ]; then + mysql_credential_args="--defaults-file=/usr/local/mysql/sys-maint.cnf" + elif [ -f "/etc/mysql/debian.cnf" ]; then + mysql_credential_args="--defaults-file=/etc/mysql/debian.cnf" + else + fatal "Cannot create new database \"$SYMPA_DB_NAME\"" + fi + mysql $mysql_credential_args -N -s -e \ + "CREATE DATABASE IF NOT EXISTS $SYMPA_DB_NAME CHARACTER SET utf8 COLLATE utf8_general_ci" + if [ "$?" != "0" ]; then + fatal "Cannot create Database \"$SYMPA_DB_NAME\"" + 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 [ "$?" != "0" ]; then + fatal "Cannot set credentials to db-user \"$SYMPA_DB_USER\" on Database \"$SYMPA_DB_NAME\"!" + fi + mysql $mysql_credential_args -N -s -e \ + "GRANT ALL ON ${SYMPA_DB_NAME}.* TO '${SYMPA_DB_USER}'@'`hostname -f`' IDENTIFIED BY '${SYMPA_DB_PASSWD}'" + if [ "$?" != "0" ]; then + fatal "Cannot set credentials to db-user \"$SYMPA_DB_USER\" on Database \"$SYMPA_DB_NAME\"!" + fi + mysql $mysql_credential_args -N -s -e \ + "USE mysql; UPDATE user SET Super_priv = 'Y' WHERE User = '$SYMPA_DB_USER'" + if [ "$?" != "0" ]; then + fatal "Cannot set \"Super_priv\" to user \"$SYMPA_DB_USER\"!" + fi + mysql $mysql_credential_args -N -s -e "FLUSH PRIVILEGES" + if [ "$?" != "0" ]; then + fatal "\"FLUSH PRIVILEGES\" failed!" + fi + mysql -h $SYMPA_DB_HOST -u $SYMPA_DB_USER -p"$SYMPA_DB_PASSWD" $SYMPA_DB_NAME -N -s -e "show tables" > /dev/null 2>&1 + if [ "$?" != "0" ]; then + fatal "Creation of Database \"$SYMPA_DB_NAME\" or setting credentials to db-user \"$SYMPA_DB_USER\" failed!" + fi + 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 + else + if ! $UPDATE_SYMPA ; then + _tables=$(mysql -u$SYMPA_DB_USER -p$SYMPA_DB_PASSWD $SYMPA_DB_NAME -N -s -e \ + 'SHOW TABLES' 2>/dev/null) + if [ -n "$_tables" ]; then + warn "Database \"$SYMPA_DB_NAME\" contains tables, but this is an initial installation!" + _empty_db="" + echononl "Empty database \"$SYMPA_DB_NAME\" now? (yes/no) [yes]: " + read _empty_db + if [ "X$_empty_db" = "X" ]; then + _empty_db=yes + fi + while [ "X$_empty_db" != "Xyes" -a "X$_empty_db" != "XYes" -a "X$_empty_db" != "XNo" -a "X$_empty_db" != "Xno" ]; do + echo "" + echononl "\twrong entry! [yes/no]: " + read OK + done + _empty_db=`echo "$_empty_db" | tr '[:upper:]' '[:lower:]'` + if [ "$_empty_db" = "yes" ]; then + _failed=false + for _table in $_tables ; do + mysql -u$SYMPA_DB_USER -p$SYMPA_DB_PASSWD $SYMPA_DB_NAME -N -s -e "DROP TABLE $_table" 2> /dev/null + if [ "$?" != "0" ]; then + _failed=true + fi + done + if $_failed ; then + error "Cleaning up database \"$SYMPA_DB_NAME\" failed!" + else + ok "Cleaning up database \"$SYMPA_DB_NAME\" was successful." + fi + fi + fi + + fi + fi +fi + +if ! $UPDATE_SYMPA ; then + echo "" + echo "--" + echo "" + __START_AT_BOOTTIME= + echononl "Start at boot time (yes/no) [${_START_AT_BOOTTIME}]: " + read __START_AT_BOOTTIME + if [ "X$__START_AT_BOOTTIME" = "X" ]; then + __START_AT_BOOTTIME=$_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 +fi + +#echo "" +#echo "--" +#echo "" +#__SYMLINK_INSTALL_DIR= +#echononl "Set sysmlink for installation directory (yes/no) [${_SYMLINK_INSTALL_DIR}]: " +#read __SYMLINK_INSTALL_DIR +#if [ "X$__SYMLINK_INSTALL_DIR" = "X" ]; then +# __SYMLINK_INSTALL_DIR=$_SYMLINK_INSTALL_DIR +#fi +#__SYMLINK_INSTALL_DIR=`echo $__SYMLINK_INSTALL_DIR | tr '[:upper:]' '[:lower:]'` +#if [ "$__SYMLINK_INSTALL_DIR" = "yes" ] ; then +# SYMLINK_INSTALL_DIR=true +#else +# SYMLINK_INSTALL_DIR=false +#fi + +if $UPDATE_SYMPA ; then + SYMPA_UID=`grep -e "^$SYMPA_USER" /etc/passwd | cut -d":" -f3` + SYMPA_GID=`grep -e "^$SYMPA_USER" /etc/passwd | cut -d":" -f4` +else + declare -i _start_gid=1000 + found=false + while ! $found ; do + if cat /etc/group | cut -d ":" -f3 | grep -w "$_start_gid" > /dev/null ; then + let _start_gid++ + else + found=true + fi + done + SYMPA_GID=$_start_gid + + + declare -i _start_uid=1000 + found=false + while ! $found ; do + if cat /etc/passwd | cut -d ":" -f3 | grep -w "$_start_uid" > /dev/null ; then + let _start_uid++ + else + found=true + fi + done + SYMPA_UID=$_start_uid +fi + + +## - Is this a system with "systemd" ? +## - +OK= +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Are you installing on a VServer guest system?" +echo "" +echononl "VServer Gastsystem (yes/no) [$_VSERVER_GUEST]: " +read OK +if [ "X$OK" = "X" ]; then + OK=$_VSERVER_GUEST +fi +OK=`echo "$OK" | tr '[:upper:]' '[:lower:]'` +while [ "X$OK" != "Xyes" -a "X$OK" != "Xno" ]; do + echo "" + echononl "\twrong entry! [yes/no]: " + read OK + OK=`echo "$OK" | tr '[:upper:]' '[:lower:]'` +done +if [ "$OK" = "yes" ]; then + SYSTEMD_EXISTS=false +else + if [ "X`which systemd`" = "X" ]; then + SYSTEMD_EXISTS=false + else + SYSTEMD_EXISTS=true + fi +fi + +if $UPDATE_SYMPA ;then + _new=false; + _update=true +else + _new=true; + _update=false +fi + +clear +echo "" +if $UPDATE_SYMPA ; then + echo -e "\033[21G\033[32mStart Sympa Update with the following Parameters \033[m" + echo "" + echo -e "-- \033[33m\033[1mUpdate (Replace an existing installation)\033[m --" +else + echo -e "\033[21G\033[32mStart Sympa Installation with the following Parameters \033[m" + echo "" + echo -e "-- \033[33m\033[1mNew (initial) installation\033[m --" +fi +echo "" +echo "Sympa version...................: $SYMPA_VERSION" +echo " First (initial) Install......: $_new" +echo " Update ......................: $_update" +echo "" +if ! $UPDATE_SYMPA ; then + echo "Sympa support for multidomains..: $SYMPA_SUPPORT_MULTIDOMAINS" +fi +echo "" +echo "Sympa user......................: $SYMPA_USER (id: ${SYMPA_UID})" +echo "Sympa group.....................: $SYMPA_GROUP (id: ${SYMPA_GID})" +echo "" +echo "Installation directory..........: $PREFIX" +echo "Sympa's bin directory...........: $SYMPA_BIN_DIR" +echo "Sympa's manpages directory......: $SYMPA_MANPATH" +echo "Sympa's main conf directory.....: $SYMPA_MAIN_CONF_DIR" +echo "Sympa's Data directory..........: $SYMPA_LIST_DATA_DIR" +echo "Sympa's aliases file............: $SYMPA_ALIAS_FILE" +if ! $UPDATE_SYMPA ; then + echo "" + echo "(default) domain................: $SYMPA_DOMAIN" + echo "Listmaster......................: $SYMPA_LISTMASTER" + echo "URL for web interface...........: $SYMPA_WEB_URL" + echo "SctiptAlias Directory...........: $_wwsympa_dir" + echo "" + echo "Database management system......: $SYMPA_DB_TYPE" + echo "Database host...................: $SYMPA_DB_HOST" + echo "Database port...................: $SYMPA_DB_PORT" + echo "Database name...................: $SYMPA_DB_NAME" + echo "Database user...................: $SYMPA_DB_USER" + echo "Database password...............: $SYMPA_DB_PASSWD" + echo "" + echo "Start at boot time..............: $START_AT_BOOTTIME" +fi +echo "Directory for init scripts......: $SYMPA_INIT_DIR" +echo "" +echo "Use systemd.....................: $SYSTEMD_EXISTS" +if ! $UPDATE_SYMPA ; then + echo "" + echo "Apache VHost directory..........: $apache_vhost_dir" + echo "Apache Log Directory............: $apache_log_dir" + echo "IPv4 Address....................: $IPv4" + echo "IPv6 Address....................: $IPv6" + echo "" + echo "Postfix Configuration Directory.: $POSTFIX_CONF_DIR" +fi +if $UPDATE_SYMPA ; then + echo "" + echo -e "-- \033[34m\033[1mSome determined defines of the installed Sympa System\033[m --" + echo "" + echo " (default) domain..................: $SYMPA_DOMAIN" + echo " Listmaster........................: $SYMPA_LISTMASTER" + echo " URL for web interface.............: $SYMPA_WEB_URL" + echo " SctiptAlias Directory.............: $_wwsympa_dir" + echo "" + echo " Database management system........: $SYMPA_DB_TYPE" + echo " Database host.....................: $SYMPA_DB_HOST" + echo " Database port.....................: $SYMPA_DB_PORT" + echo " Database name.....................: $SYMPA_DB_NAME" + echo " Database user.....................: $SYMPA_DB_USER" + echo " Database password.................: $SYMPA_DB_PASSWD" + echo "" +fi +echo "" + +echononl "Start with that configuration? [yes/no]: " +read OK +while [ "X$OK" != "Xyes" -a "X$OK" != "XYes" -a "X$OK" != "XNo" -a "X$OK" != "Xno" ] +do + echononl "wrong entry! [yes/no] :" + read OK +done +[ $OK = "Yes" -o $OK = "yes" ] || fatal "Change parameters and restart script: `basename $0`" + +echo "" +echo "" + +echononl "\tCreate base source directory" +if [ ! -d "$_srcdir" ]; then + mkdir -p $_srcdir + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal "Cannot create base source directory" + fi +else + echo_skipped +fi + + +if [ -d "$_logdir" ];then + echononl "\tBackup existing log directory \"`basename ${_logdir}`\" .. .." + mv $_logdir $_logdir.`date +%Y%m%d-%H%M` + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal "Cannot move log directory \"${_logdir}\"!" + fi +fi +echononl "\tCreate log directory \"`basename ${_logdir}`\".." +mkdir -p $_logdir > /dev/null 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal "Cannot create log directory \"${_logdir}\"!" +fi + +touch $_log_file +echo "## -----------" >> $_log_file +if $UPDATE_SYMPA ; then + echo "## - Start of Sympa Update with the following Parameters" >> $_log_file +else + echo "## - Start of Sympa Installation with the following Parameters" >> $_log_file +fi +echo "## -----------" >> $_log_file +echo "## -" >> $_log_file +echo "## - Sympa version.....................: $SYMPA_VERSION" >> $_log_file +echo "## - First (initial) Install........: $_new" >> $_log_file +echo "## - Update ........................: $_update" >> $_log_file +echo "" +if ! $UPDATE_SYMPA ; then + echo "## - Sympa support for multidomains....: $SYMPA_SUPPORT_MULTIDOMAINS" >> $_log_file +fi +echo "## -" >> $_log_file +echo "## - Sympa user........................: $SYMPA_USER" >> $_log_file +echo "## - Sympa group.......................: $SYMPA_GROUP" >> $_log_file +echo "## -" >> $_log_file +echo "## - Installation directory............: $PREFIX" >> $_log_file +echo "## - Sympa's bin directory.............: $SYMPA_BIN_DIR" >> $_log_file +echo "## - Sympa's manpages directory........: $SYMPA_MANPATH" >> $_log_file +echo "## - Sympa's main conf directory.......: $SYMPA_MAIN_CONF_DIR" >> $_log_file +echo "## - Sympa's Data directory...........: $SYMPA_LIST_DATA_DIR" >> $_log_file +echo "## - Sympa's aliases file..............: $SYMPA_ALIAS_FILE" >> $_log_file +echo "## -" >> $_log_file +if ! $UPDATE_SYMPA ; then + echo "## -" >> $_log_file + echo "## - (default) domain..................: $SYMPA_DOMAIN" >> $_log_file + echo "## - Listmaster........................: $SYMPA_LISTMASTER" >> $_log_file + echo "## - URL for web interface.............: $SYMPA_WEB_URL" >> $_log_file + echo "## - SctiptAlias Directory.............: $_wwsympa_dir" >> $_log_file + echo "## -" >> $_log_file + echo "## - Database management system........: $SYMPA_DB_TYPE" >> $_log_file + echo "## - Database host.....................: $SYMPA_DB_HOST" >> $_log_file + echo "## - Database port.....................: $SYMPA_DB_PORT" >> $_log_file + echo "## - Database name.....................: $SYMPA_DB_NAME" >> $_log_file + echo "## - Database user.....................: $SYMPA_DB_USER" >> $_log_file + echo "## - Database password.................: $SYMPA_DB_PASSWD" >> $_log_file +fi +if ! $UPDATE_SYMPA ; then + echo "## -" >> $_log_file + echo "## - Start at boot time................: $START_AT_BOOTTIME" >> $_log_file +fi +echo "## - Directory for init scripts........: $SYMPA_INIT_DIR" >> $_log_file +echo "## -" >> $_log_file +echo "## - Use systemd.......................: $SYSTEMD_EXISTS" >> $_log_file +echo "## -" >> $_log_file +if ! $UPDATE_SYMPA ; then + echo "## - Apache VHost directory............: $apache_vhost_dir" >> $_log_file + echo "## - Apache Log Directory..............: $apache_log_dir" >> $_log_file + echo "## - IPv4 Address......................: $IPv4" >> $_log_file + echo "## - IPv6 Address......................: $IPv6" >> $_log_file + echo "## -" >> $_log_file + echo "## - Postfix Configuration Directory...: $POSTFIX_CONF_DIR" >> $_log_file +fi +if $UPDATE_SYMPA ; then + echo "## --- Some determined defines of the installed Sympa System" >> $_log_file + echo "## -" >> $_log_file + echo "## - (default) domain...............: $SYMPA_DOMAIN" >> $_log_file + echo "## - Listmaster.....................: $SYMPA_LISTMASTER" >> $_log_file + echo "## - URL for web interface..........: $SYMPA_WEB_URL" >> $_log_file + echo "## - SctiptAlias Directory..........: $_wwsympa_dir" >> $_log_file + echo "## -" >> $_log_file + echo "## - Database management system.....: $SYMPA_DB_TYPE" >> $_log_file + echo "## - Database host..................: $SYMPA_DB_HOST" >> $_log_file + echo "## - Database port..................: $SYMPA_DB_PORT" >> $_log_file + echo "## - Database name..................: $SYMPA_DB_NAME" >> $_log_file + echo "## - Database user..................: $SYMPA_DB_USER" >> $_log_file + echo "## - Database password..............: $SYMPA_DB_PASSWD" >> $_log_file + echo "## -" >> $_log_file +fi +echo "## -" >> $_log_file +echo "" >> $_log_file +echo "" >> $_log_file + +echo "SYMPA_VERSION=$SYMPA_VERSION" >> $_log_file +echo "" >> $_log_file +echo "UPDATE_SYMPA=$UPDATE_SYMPA" >> $_log_file +echo "" >> $_log_file +if ! $UPDATE_SYMPA ; then + echo "SYMPA_SUPPORT_MULTIDOMAINS=$SYMPA_SUPPORT_MULTIDOMAINS" >> $_log_file +fi +echo "SYMPA_USER=$SYMPA_USER" >> $_log_file +echo "SYMPA_GROUP=$SYMPA_GROUP" >> $_log_file +echo "" >> $_log_file +echo "PREFIX=$PREFIX" >> $_log_file +echo "SYMPA_MAIN_CONF_DIR=$SYMPA_MAIN_CONF_DIR" >> $_log_file +echo "SYMPA_BIN_DIR=$SYMPA_BIN_DIR" >> $_log_file +echo "SYMPA_MANPATH=$SYMPA_MANPATH" >> $_log_file +echo "SYMPA_LIST_DATA_DIR=$SYMPA_LIST_DATA_DIR" >> $_log_file +echo "SYMPA_ALIAS_FILE=$SYMPA_ALIAS_FILE" >> $_log_file +echo "" >> $_log_file +echo "SYMPA_DOMAIN=$SYMPA_DOMAIN" >> $_log_file +echo "SYMPA_LISTMASTER=$SYMPA_LISTMASTER" >> $_log_file +echo "SYMPA_WEB_URL=$SYMPA_WEB_URL" >> $_log_file +echo "_wwsympa_dir=$_wwsympa_dir" >> $_log_file +echo "" >> $_log_file +echo "SYMPA_DB_TYPE=$SYMPA_DB_TYPE" >> $_log_file +echo "SYMPA_DB_HOST=$SYMPA_DB_HOST" >> $_log_file +echo "SYMPA_DB_PORT=$SYMPA_DB_PORT" >> $_log_file +echo "SYMPA_DB_NAME=$SYMPA_DB_NAME" >> $_log_file +echo "SYMPA_DB_USER=$SYMPA_DB_USER" >> $_log_file +echo "SYMPA_DB_PASSWD=$SYMPA_DB_PASSWD" >> $_log_file +if ! $UPDATE_SYMPA ; then + echo "START_AT_BOOTTIME=$START_AT_BOOTTIME" >> $_log_file +fi +echo "SYMPA_INIT_DIR=$SYMPA_INIT_DIR" >> $_log_file +echo "" >> $_log_file +if ! $UPDATE_SYMPA ; then + echo "apache_vhost_dir=$apache_vhost_dir" >> $_log_file + echo "apache_log_dir=$apache_log_dir" >> $_log_file + echo "IPv4=$IPv4" >> $_log_file + echo "IPv6=$IPv6" >> $_log_file +fi +echo "" >> $_log_file +if ! $UPDATE_SYMPA ; then + echo "POSTFIX_CONF_DIR=$POSTFIX_CONF_DIR" >> $_log_file +fi +echo "" >> $_log_file +echo "SYSTEMD_EXISTS=$SYSTEMD_EXISTS" >> $_log_file + +echo "" >> $_log_file +echo "_srcdir=$_srcdir" >> $_log_file +echo "_builddir=$_builddir" >> $_log_file +echo "_logdir=$_logdir" >> $_log_file + +echo "" + +## - +echo "" >> $_log_file +echo "## - Change into base source directory \"$_srcdir\" .." >> $_log_file +echo "## -" >> $_log_file +echo "cd $_srcdir" >> $_log_file +cd $_srcdir >> $_log_file 2>&1 || fatal "Changing Directory (cd) to \"${_srcdir}\" failed!" + +echononl "\tGet source sympa-${SYMPA_VERSION}.tar.gz .." + +if [ ! -f sympa-${SYMPA_VERSION}.tar.gz ]; then + echo "" >> $_log_file + echo "## - Get source sympa-${SYMPA_VERSION}.tar.gz .." >> $_log_file + echo "## -" >> $_log_file + echo "wget https://www.sympa.org/distribution/sympa-${SYMPA_VERSION}.tar.gz" >> $_log_file + wget https://www.sympa.org/distribution/sympa-${SYMPA_VERSION}.tar.gz >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal "Download of \"sympa-${SYMPA_VERSION}.tar.gz\" failed!" + fi +else + echo_skipped +fi + +echo "" + +if ! $UPDATE_SYMPA ; then + + echononl "\tAdding Group \"$SYMPA_GROUP\".." + if ! grep $SYMPA_GROUP /etc/group > /dev/null ; then + echo "" >> $_log_file + echo "## - Adding Group \"$SYMPA_GROUP\".." >> $_log_file + echo "## -" >> $_log_file + echo "addgroup --gid $SYMPA_GID $SYMPA_GROUP" >> $_log_file + addgroup --gid $SYMPA_GID $SYMPA_GROUP >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fi + else + echo_skipped + fi + + echononl "\tAdding User \"$SYMPA_USER\".." + if ! grep $SYMPA_USER /etc/passwd > /dev/null ; then + echo "" >> $_log_file + echo "## - Adding User \"$SYMPA_USER\".." >> $_log_file + echo "## -" >> $_log_file + echo "adduser --uid $SYMPA_UID --gid $SYMPA_GID --home $PREFIX --disabled-password \\" >> $_log_file + echo " --gecos \"Sympa mailing list manager\" $SYMPA_USER" >> $_log_file + adduser --uid $SYMPA_UID --gid $SYMPA_GID --home $PREFIX --disabled-password \ + --gecos "Sympa mailing list manager" $SYMPA_USER >> $_log_file + + #echo "adduser --system --home /usr/local/sympa --no-create-home --shell /bin/sh \\" >> $_log_file + #echo " --gid $SYMPA_GID --uid $SYMPA_UID --gecos \"Sympa mailing list manager\" $SYMPA_USER" >> $_log_file + #adduser --system --home /usr/local/sympa --no-create-home --shell /bin/sh \ + # --gid $SYMPA_GID --uid $SYMPA_UID --gecos "Sympa mailing list manager" $SYMPA_USER > $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fi + else + echo_skipped + fi + + echo "" + + ## - Sympa alias file + ## - + if [ -n "$SYMPA_ALIAS_FILE" ]; then + _dir=`dirname $SYMPA_ALIAS_FILE` + _create_dir=true + echononl "\tCreate directory \"$_dir\".." + echo "" >> $_log_file + echo "## - Create directory \"$_dir\" (contains sympa alias file).." >> $_log_file + echo "## -" >> $_log_file + if [ ! -d "$_dir" ]; then + echo "mkdir -p $_dir" $_log_file + mkdir -p $_dir >> $_log_file + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Creation of dir \"$_dir\" failed!" + _create_dir=false + fi + else + echo_skipped + echo "## - \"$_dir\" alredy exists" >> $_log_file + echo "## -" >> $_log_file + fi + echononl "\tCreate alias file \"$SYMPA_ALIAS_FILE\".." + echo "" >> $_log_file + echo "## - Create alias file \"$SYMPA_ALIAS_FILE\".." >> $_log_file + echo "## -" >> $_log_file + if [ ! -f "$SYMPA_ALIAS_FILE" ]; then + echo "touch $SYMPA_ALIAS_FILE" >> $_log_file + touch $SYMPA_ALIAS_FILE >> $_log_file + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Creation of alias file \"$SYMPA_ALIAS_FILE\" failed!" + fi + else + echo_skipped + echo "## - Alias file \"$SYMPA_ALIAS_FILE\" alredy exists" >> $_log_file + echo "## -" >> $_log_file + fi + fi + echononl "\tChange group for \"$SYMPA_ALIAS_FILE\".." + echo "" >> $_log_file + echo "## - Change group for \"$SYMPA_ALIAS_FILE\".." >> $_log_file + echo "## -" >> $_log_file + echo "chgrp $SYMPA_GROUP $SYMPA_ALIAS_FILE" >> $_log_file + chgrp $SYMPA_GROUP $SYMPA_ALIAS_FILE >> $_log_file + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Cannot set ownerchip ($SYMPA_USER:$SYMPA_GROUP) to \"$SYMPA_ALIAS_FILE\"!" + fi + echononl "\tSet permissions on \"$SYMPA_ALIAS_FILE\".." + echo "" >> $_log_file + echo "## - Set permissions on \"$SYMPA_ALIAS_FILE\".." >> $_log_file + echo "## -" >> $_log_file + echo "chmod 664 $SYMPA_ALIAS_FILE" >> $_log_file + chmod 664 $SYMPA_ALIAS_FILE >> $_log_file + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Cannot set ownerchip ($SYMPA_USER:$SYMPA_GROUP) to \"$SYMPA_ALIAS_FILE\"!" + fi + + + ## - Install reqired debian packages + ## - + + declare -a required_debian_packages_arr + for _debian_pkg in $_required_debian_packages ; do + perl_modules_arr+=("$_debian_pkg") + done + > ${_logdir}/debian-install.log + + echo "" + echo -e "\tInstalling required debian packages .." + + for _debian_pkg in ${perl_modules_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!" + fi + else + echo_skipped + 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 + echo "locale-gen" >> $_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 +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!" + 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 + if [ "$?" = 0 ]; then + echo_ok + else + echo_failed + error "Adding Environment Variable \"PERL5LIB\" to /etc/profile failed!" + fi + else + echo_skipped + fi + + ## - Make PERL5LIB also present in that shell + ## - + export PERL5LIB=/usr/share/mhonarc + +else + + # Stop apache webservice + ## + HTTPD=`realpath $(which httpd) 2>/dev/null` + if [ -z "$HTTPD" ]; then + if [ -x "/usr/local/apache2/bin/httpd" ]; then + HTTPD=`realpath "/usr/local/apache2/bin/httpd"` + else + HTTPD=`realpath $(which apache2) 2>/dev/null` + if [ -z "$HTTPD" ]; then + fatal 'Command \"httpd\"/\"apache2\" not found!' + fi + fi + fi + + echononl "\tStopping Apache Webserver .." + _PID=`ps aux | grep "$HTTPD " | grep -e "^root" | grep -v grep | awk '{print$2}'` + if [ -n "$_PID" ];then + if $SYSTEMD_EXISTS ; then + echo "systemctl stop apache2" >> $_log_file + systemctl stop apache2 >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fi + else + echo "$APACHE_INIT_SCRIPT stop" >> $_log_file + $APACHE_INIT_SCRIPT stop >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fi + fi + else + echo_skipped + fi + + sleep 2 + _PIDS=`ps aux | grep "$HTTPD " |grep -v grep | awk '{print$2}'` + + if [ -n "$_PIDS" ]; then + warn "Found running webserver processes. Going to kill them.." + for _pid in $_PIDS ; do + kill -9 $_pid > /dev/null 2>&1 + done + fi + + ## - Stop Sympa list manager + ## - + echononl "\tStopping Sympa mailing list manager .." + if ps -e f | grep ${Prefix}/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 + if $SYSTEMD_EXISTS ; then + echo "systemctl stop sympa" >> $_log_file + systemctl stop sympa >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fi + else + echo "${SYMPA_INIT_DIR}/sympa stop" >> $_log_file + ${SYMPA_INIT_DIR}/sympa stop >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fi + fi + else + echo_skipped + fi + _PIDS=`ps -e f | grep ${PREFIX}/bin/ 2>/dev/null | grep -v grep | awk '{print$1}'` + + if [ -n "$_PIDS" ]; then + warn "Found running sympa processes. Going to kill them.." + for _pid in $_PIDS ; do + kill -9 $_pid > /dev/null 2>&1 + done + fi + + _date=`date +%Y%m%d-%H%M` + echononl "\tBackup existing installation directory ($PREFIX) .." + echo "" >> $_log_file + echo "## - Backup existing installation directory ($PREFIX) .." >> $_log_file + echo "## -" >> $_log_file + echo "cp -a $PREFIX ${PREFIX}.${SYMPA_OLD_VERSION}.BAK.$_date" >> $_log_file + cp -a $PREFIX ${PREFIX}.${SYMPA_OLD_VERSION}.$_date >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Cannot Backup existing installation directory \"$PREFIX\"!" + + _proceed="" + echononl "Type uppercase \"yes\" to proceed anyway: " + read _proceed + [[ "$_proceed" == "YES" ]] || fatal "Exiting by user request.." + fi + + echononl "\tBackup existing list directory ($SYMPA_LIST_DATA_DIR) .." + echo "" >> $_log_file + echo "## - Backup existing list directory ($SYMPA_LIST_DATA_DIR) .." >> $_log_file + echo "## -" >> $_log_file + echo "cp -a $SYMPA_LIST_DATA_DIR ${SYMPA_LIST_DATA_DIR}.$_date" >> $_log_file + cp -a $SYMPA_LIST_DATA_DIR ${SYMPA_LIST_DATA_DIR}.$_date >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Cannot Backup existing lists data directory \"$PREFIX\"!" + + _proceed="" + echononl "Type uppercase \"yes\" to proceed anyway: " + read _proceed + [[ "$_proceed" == "YES" ]] || fatal "Exiting by user request.." + fi + + if [ "$SYMPA_DB_TYPE" == "mysql" ]; then + echononl "\tDump Database \"$SYMPA_DB_NAME\" .." + echo "" >> $_log_file + echo "## - Dump Database \"$SYMPA_DB_NAME\" .." >> $_log_file + echo "## -" >> $_log_file + echo "mysqldump -h $SYMPA_DB_HOST -u $SYMPA_DB_USER -p$SYMPA_DB_PASSWD --opt $SYMPA_DB_NAME > ${PREFIX}.${SYMPA_OLD_VERSION}.BAK.${_date}/${SYMPA_DB_NAME}-${_date}.sql" >> $_log_file + #mysqldump -h $SYMPA_DB_HOST -u $SYMPA_DB_USER -p$SYMPA_DB_PASSWD --opt $SYMPA_DB_NAME > ${PREFIX}.${SYMPA_OLD_VERSION}.BAK.${_date}/${SYMPA_DB_NAME}-${_date}.sql 2>> $_log_file + mysqldump -h $SYMPA_DB_HOST -u $SYMPA_DB_USER -p$SYMPA_DB_PASSWD --opt $SYMPA_DB_NAME > `dirname ${PREFIX}`/${SYMPA_DB_NAME}.${SYMPA_OLD_VERSION}.${_date}.sql 2>> $_log_file + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Cannot Backup existing database \"$SYMPA_DB_NAME\"!" + + _proceed="" + echononl "Type uppercase \"yes\" to proceed anyway: " + read _proceed + [[ "$_proceed" == "YES" ]] || fatal "Exiting by user request.." + fi + else + warn "No Backup for database type "$SYMPA_DB_TYPE" implemented." + _proceed="" + echononl "Type uppercase \"yes\" to proceed anyway: " + read _proceed + [[ "$_proceed" == "YES" ]] || fatal "Exiting by user request.." + fi + + echononl "\tBackup existing init script .." + echo "" >> $_log_file + echo "## - Backup existing init script .." >> $_log_file + echo "## -" >> $_log_file + echo "cp -a ${SYMPA_INIT_DIR}/sympa ${SYMPA_INIT_DIR}/sympa.$_date" >> $_log_file + cp -a ${SYMPA_INIT_DIR}/sympa ${SYMPA_INIT_DIR}/sympa.$_date >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Cannot Backup existing init script \"${SYMPA_INIT_DIR}/sympa\"!" + + _proceed="" + echononl "Type uppercase \"yes\" to proceed anyway: " + read _proceed + [[ "$_proceed" == "YES" ]] || fatal "Exiting by user request.." + fi + +fi + + +echo +echo -e "\t---" +echo -e "\t--- Installation of Sympa mailing list server (${SYMPA_VERSION})" +echo -e "\t---" +echo"" + +echo "" >> $_log_file +echo -e "## ---" >> $_log_file +echo -e "## --- Installation of Sympa mailing list server (${SYMPA_VERSION})" >> $_log_file +echo -e "## ---" >> $_log_file +echo"" >> $_log_file + + +echononl "\tMove (backup) existing source directory ..." +if [ -d "$_builddir" ];then + echo "" >> $_log_file + echo "## - Move (backup) existing source directory ..." >> $_log_file + echo "## -" >> $_log_file + echo "mv $_builddir $_builddir.`date +%Y%m%d-%H%M`" >> $_log_file + mv $_builddir $_builddir.`date +%Y%m%d-%H%M` >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal "Cannot move (backup) source directory \"${_builddir}\" .." + fi +else + echo_skipped +fi + +## - Unpack source archive +## - +echo "" >> $_log_file +echo "## - Change into base source directory \"$_srcdir\" .." >> $_log_file +echo "## -" >> $_log_file +echo "cd $_srcdir" >> $_log_file +cd $_srcdir + +echo "" >> $_log_file +echo "## - Unpack sympa-${SYMPA_VERSION}.tar.gz .." >> $_log_file +echo "## -" >> $_log_file +echo "gzip -dc sympa-${SYMPA_VERSION}.tar.gz | tar xf -" >> $_log_file +echononl "\tUnpack sympa-${SYMPA_VERSION}.tar.gz .." +gzip -dc sympa-${SYMPA_VERSION}.tar.gz | tar xf - >> $_log_file 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal "Cannot unpack archive sympa-${SYMPA_VERSION}.tar.gz .." +fi + + +## - Configure sympa +## - +echo "" >> $_log_file +echo "## - Change into sympa source directory \"$_builddir\" .." >> $_log_file +echo "## -" >> $_log_file +echo "cd $_builddir" >> $_log_file +cd $_builddir >> $_log_file 2>&1 || fatal "Changing Directory (cd) to \"${_builddir}\" failed!" + +echo "" >> $_log_file +echo "## - Configure sympa-${SYMPA_VERSION} .." >> $_log_file +echo "## -" >> $_log_file +echo "## - See ${_logdir}/sympa-configure.log for more details" >> $_log_file +echo "## -" >> $_log_file +echononl "\tConfiguring sympa-${SYMPA_VERSION} .." + +config_params=" --prefix=$PREFIX + --with-initdir=$SYMPA_INIT_DIR + --with-confdir=$SYMPA_MAIN_CONF_DIR + --with-expldir=$SYMPA_LIST_DATA_DIR + --with-aliases_file=$SYMPA_ALIAS_FILE + --with-user=$SYMPA_USER + --with-group=$SYMPA_GROUP" + +cat << EOF >> $_log_file +LDFLAGS="-s" \\ +./configure $config_params > ${_logdir}/sympa-configure.log 2>&1 +EOF + +LDFLAGS="-s" \ +./configure $config_params > ${_logdir}/sympa-configure.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal "Configuring sympa-${SYMPA_VERSION} failed!" +fi + + +echo "" >> $_log_file +echo "## - Compiling sympa-${SYMPA_VERSION} .." >> $_log_file +echo "## -" >> $_log_file +echo "## - See ${_logdir}/sympa-make.log for more details" >> $_log_file +echo "## -" >> $_log_file +echo "make > ${_logdir}/sympa-make.log 2>&1" >> $_log_file +echononl "\tCompiling sympa-${SYMPA_VERSION} .." +make > ${_logdir}/sympa-make.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal "Compiling sympa-${SYMPA_VERSION} failed!" +fi + +## - Notice! +## - +## - In case of Updating an existent installation, we have already backuped the +## - installatio directory. +## - +if ! $UPDATE_SYMPA ; then + echononl "\tBackup existing installation directory.." + if [ -d "$PREFIX" ];then + echo "" >> $_log_file + echo "## - Backup existing installation directory.." >> $_log_file + echo "## -" >> $_log_file + echo "mv $PREFIX $PREFIX.`date +%Y%m%d-%H%M`" >> $_log_file + mv $PREFIX $PREFIX.`date +%Y%m%d-%H%M` >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal "Cannot move (backup) existing install directory \"${_builddir}\" .." + fi + else + echo_skipped + fi +fi + +if $UPDATE_SYMPA ; then + + _successfully=true + info "Sorry, but you have to install files in an seperate terminal.\n\t After finished, continue with this script." + echo -e "\tType:" + echo -e "\t cd $_builddir" + echo -e "\t make install " + echo "" + echononl "Was the installation sucessfully? [yes/no]: " + read OK + while [ "X$OK" != "Xyes" -a "X$OK" != "XYes" -a "X$OK" != "XNo" -a "X$OK" != "Xno" ] + do + echononl "wrong entry! [yes/no] :" + read OK + done + [ $OK = "Yes" -o $OK = "yes" ] || _successfully=false + echo "" + + if ! $_successfully ; then + echononl "\tInstall previous sympa init script" + echo_skipped + echononl "\tReorganize Database.." + echo_skipped + echononl "\tRestore Sympa's Installation Directory" + echo_skipped + echononl "\tRestore Sympa's List Data Directory" + echo_skipped + warn "Moving back to previous installation not yet implemented!" + fatal "Exiting: Installation was not successfully!" + fi + + echononl "\tPerform DB changes an updates of the the configuration files.." + echo "" >> $_log_file + echo "## - Perform DB changes an updates of the the configuration files if required." >> $_log_file + echo "## -" >> $_log_file + echo "${SYMPA_BIN_DIR}/sympa.pl --upgrade" >> $_log_file + ${SYMPA_BIN_DIR}/sympa.pl --upgrade >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "\"${SYMPA_BIN_DIR}/sympa.pl --upgrade\" failed!" + fi + + if $SYSTEMD_EXISTS ; then + echononl "\tReload systemd configuration.." + echo "" >> $_log_file + echo "## - Reload systemd configuration.." >> $_log_file + echo "## -" >> $_log_file + echo "systemctl daemon-reload" >> $_log_file + systemctl daemon-reload >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Reloading systemd configuration failed!" + fi + fi + +else + echo "" >> $_log_file + echo "## - Install Sympa mailing list server (v ${SYMPA_VERSION}) .." >> $_log_file + echo "## -" >> $_log_file + echo "## - See ${_logdir}/sympa-make_install.log for more details" >> $_log_file + echo "## -" >> $_log_file + echo "make install > ${_logdir}/sympa-make_install.log 2>&1" >> $_log_file + echononl "\tInstall Sympa mailing list server.." + make install > ${_logdir}/sympa-make_install.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal "Installing Sympa mailing list server (v ${SYMPA_VERSION}) failed!" + fi +fi + +#if $SYMLINK_INSTALL_DIR ; then +# +# if [ -h "/usr/local/sympa" ]; then +# echo "" >> $_log_file +# echo "## - Remove existing symlink /usr/local/sympa .." >> $_log_file +# echo "## -" >> $_log_file +# echo "rm /usr/local/sympa" >> $_log_file +# echononl "\tRemove existing symlink /usr/local/sympa .." +# rm /usr/local/sympa >> $_log_file 2>&1 +# if [ "$?" = "0" ]; then +# echo_ok +# else +# echo_failed +# warn "Remove existing symlink /usr/local/sympa failed!" +# fi +# fi +# +# echo "" >> $_log_file +# echo "## - Set Symlink /usr/local/sympa .." >> $_log_file +# echo "## - ln -s `basename $PREFIX` /usr/local/sympa" >> $_log_file +# echo "" >> $_log_file +# echononl "\tSet Symlink /usr/local/sympa .." +# ln -s `basename $PREFIX` /usr/local/sympa >> $_log_file 2>&1 +# if [ "$?" = "0" ]; then +# echo_ok +# else +# echo_failed +# warn "Setting symlink /usr/local/sympa failed" +# fi +#fi + +echo "" +echo -e "\t---" +echo -e "\t--- Configure Sympa mailing list manager (base configuration)" +echo -e "\t---" +echo"" + +echo "" >> $_log_file +echo -e "## ---" >> $_log_file +echo -e "## --- Configure Sympa mailing list manager (base configuration)" >> $_log_file +echo -e "## ---" >> $_log_file +echo"" >> $_log_file + +if $UPDATE_SYMPA ; then + info "Configuration will be omitted. \"sympa.conf\" is taken over from existing installation." + + + #echo -e "\t[ \033[33m\033[1mImportant\033[m ]: For changes which are not compartible with previous versions," + #echo " see file \"${_builddir}/NEWS\"." + #echo " See \"${_builddir}/ChangeLog\" for the full changes log." + + echo "" >> $_log_file + + echo "# --- Configuration will be omitted. \"sympa.conf\" is taken over from existing installation." >> $_log_file + echo "# ---" >> $_log_file + echo "# --- For changes which are not compartible with previous versions," >> $_log_file + echo "# --- see file \"${_builddir}/NEWS\"." >> $_log_file + echo "# ---" >> $_log_file + echo "# --- See \"${_builddir}/ChangeLog\" for the full changes log." >> $_log_file + +else + + _key=domain + _val=$SYMPA_DOMAIN + echo "" >> $_log_file + echo "## - Set \"$_key\" in file ${SYMPA_MAIN_CONF_DIR}/sympa.conf .." >> $_log_file + echo "## -" >> $_log_file + echo "" >> $_log_file + echononl "\tSet \"$_key\" in file ${SYMPA_MAIN_CONF_DIR}/sympa.conf .." + echo "perl -i.ORIG -n -p -e \"s#^(\s*\#\s*${_key}.*)#\1\n$_key\t$_val#\" ${SYMPA_MAIN_CONF_DIR}/sympa.conf" >> $_log_file + perl -i.ORIG -n -p -e "s#^(\s*\#\s*${_key}.*)#\1\n$_key\t$_val#" ${SYMPA_MAIN_CONF_DIR}/sympa.conf >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal "Cannot set \"$_key\" in file \"${SYMPA_MAIN_CONF_DIR}/sympa.conf\" .." + fi + + ## - Replace "@" with "\@" + ## - + echo "SYMPA_LISTMASTER=\`echo \${SYMPA_LISTMASTER//\\@/\\\\\@}\`" >> $_log_file + SYMPA_LISTMASTER=`echo ${SYMPA_LISTMASTER//\@/\\\@}` + + _key=listmaster + _val=$SYMPA_LISTMASTER + echo "" >> $_log_file + echo "## - Set \"$_key\" in file ${SYMPA_MAIN_CONF_DIR}/sympa.conf .." >> $_log_file + echo "## -" >> $_log_file + echononl "\tSet \"$_key\" in file ${SYMPA_MAIN_CONF_DIR}/sympa.conf .." + echo "perl -i -n -p -e \"s#^(\s*\#\s*${_key}.*)#\1\n$_key\t$_val#\" ${SYMPA_MAIN_CONF_DIR}/sympa.conf" >> $_log_file + perl -i -n -p -e "s#^(\s*\#\s*${_key}.*)#\1\n$_key\t$_val#" ${SYMPA_MAIN_CONF_DIR}/sympa.conf >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal "Cannot set \"$_key\" in file \"${SYMPA_MAIN_CONF_DIR}/sympa.conf\" .." + fi + + _key=wwsympa_url + _val="$SYMPA_WEB_URL" + echo "" >> $_log_file + echo "## - Set \"$_key\" in file ${SYMPA_MAIN_CONF_DIR}/sympa.conf .." >> $_log_file + echo "## -" >> $_log_file + echononl "\tSet \"$_key\" in file ${SYMPA_MAIN_CONF_DIR}/sympa.conf .." + echo "perl -i -n -p -e \"s#^(\s*\#\s*${_key}.*)#\1\n$_key\t$_val#\" ${SYMPA_MAIN_CONF_DIR}/sympa.conf" >> $_log_file + perl -i -n -p -e "s#^(\s*\#\s*${_key}.*)#\1\n$_key\t$_val#" ${SYMPA_MAIN_CONF_DIR}/sympa.conf >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal "Cannot set \"$_key\" in file \"${SYMPA_MAIN_CONF_DIR}/sympa.conf\" .." + fi + + _key=home + _val="$SYMPA_LIST_DATA_DIR" + echo "" >> $_log_file + echo "## - Set \"$_key\" in file ${SYMPA_MAIN_CONF_DIR}/sympa.conf .." >> $_log_file + echo "## -" >> $_log_file + echononl "\tSet \"$_key\" in file ${SYMPA_MAIN_CONF_DIR}/sympa.conf .." + echo "perl -i -n -p -e \"s#^(\s*\#\s*${_key}.*)#\1\n$_key\t$_val#\" ${SYMPA_MAIN_CONF_DIR}/sympa.conf" >> $_log_file + perl -i -n -p -e "s#^(\s*\#\s*${_key}.*)#\1\n$_key\t$_val#" ${SYMPA_MAIN_CONF_DIR}/sympa.conf >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal "Cannot set \"$_key\" in file \"${SYMPA_MAIN_CONF_DIR}/sympa.conf\" .." + fi + + _key=db_type + _val="$SYMPA_DB_TYPE" + echo "" >> $_log_file + echo "## - Set \"$_key\" in file ${SYMPA_MAIN_CONF_DIR}/sympa.conf .." >> $_log_file + echo "## -" >> $_log_file + echononl "\tSet \"$_key\" in file ${SYMPA_MAIN_CONF_DIR}/sympa.conf .." + echo "perl -i -n -p -e \"s#^(\s*\#\s*${_key}.*)#\1\n$_key\t$_val#\" ${SYMPA_MAIN_CONF_DIR}/sympa.conf" >> $_log_file + perl -i -n -p -e "s#^(\s*\#\s*${_key}.*)#\1\n$_key\t$_val#" ${SYMPA_MAIN_CONF_DIR}/sympa.conf >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal "Cannot set \"$_key\" in file \"${SYMPA_MAIN_CONF_DIR}/sympa.conf\" .." + fi + + _key=db_name + _val="$SYMPA_DB_NAME" + echo "" >> $_log_file + echo "## - Set \"$_key\" in file ${SYMPA_MAIN_CONF_DIR}/sympa.conf .." >> $_log_file + echo "## -" >> $_log_file + echononl "\tSet \"$_key\" in file ${SYMPA_MAIN_CONF_DIR}/sympa.conf .." + echo "perl -i -n -p -e \"s#^(\s*\#\s*${_key}.*)#\1\n$_key\t$_val#\" ${SYMPA_MAIN_CONF_DIR}/sympa.conf" >> $_log_file + perl -i -n -p -e "s#^(\s*\#\s*${_key}.*)#\1\n$_key\t$_val#" ${SYMPA_MAIN_CONF_DIR}/sympa.conf >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal "Cannot set \"$_key\" in file \"${SYMPA_MAIN_CONF_DIR}/sympa.conf\" .." + fi + + _key=db_host + _val="$SYMPA_DB_HOST" + echo "" >> $_log_file + echo "## - Set \"$_key\" in file ${SYMPA_MAIN_CONF_DIR}/sympa.conf .." >> $_log_file + echo "## -" >> $_log_file + echononl "\tSet \"$_key\" in file ${SYMPA_MAIN_CONF_DIR}/sympa.conf .." + echo "perl -i -n -p -e \"s#^(\s*\#\s*${_key}.*)#\1\n$_key\t$_val#\" ${SYMPA_MAIN_CONF_DIR}/sympa.conf" >> $_log_file + perl -i -n -p -e "s#^(\s*\#\s*${_key}.*)#\1\n$_key\t$_val#" ${SYMPA_MAIN_CONF_DIR}/sympa.conf >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal "Cannot set \"$_key\" in file \"${SYMPA_MAIN_CONF_DIR}/sympa.conf\" .." + fi + + _key=db_port + _val="$SYMPA_DB_PORT" + echo "" >> $_log_file + echo "## - Set \"$_key\" in file ${SYMPA_MAIN_CONF_DIR}/sympa.conf .." >> $_log_file + echo "## -" >> $_log_file + echononl "\tSet \"$_key\" in file ${SYMPA_MAIN_CONF_DIR}/sympa.conf .." + echo "perl -i -n -p -e \"s#^(\s*\#\s*${_key}.*)#\1\n$_key\t$_val#\" ${SYMPA_MAIN_CONF_DIR}/sympa.conf" >> $_log_file + perl -i -n -p -e "s#^(\s*\#\s*${_key}.*)#\1\n$_key\t$_val#" ${SYMPA_MAIN_CONF_DIR}/sympa.conf >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal "Cannot set \"$_key\" in file \"${SYMPA_MAIN_CONF_DIR}/sympa.conf\" .." + fi + + _key=db_user + _val="$SYMPA_DB_USER" + echo "" >> $_log_file + echo "## - Set \"$_key\" in file ${SYMPA_MAIN_CONF_DIR}/sympa.conf .." >> $_log_file + echo "## -" >> $_log_file + echononl "\tSet \"$_key\" in file ${SYMPA_MAIN_CONF_DIR}/sympa.conf .." + echo "perl -i -n -p -e \"s#^(\s*\#\s*${_key}.*)#\1\n$_key\t$_val#\" ${SYMPA_MAIN_CONF_DIR}/sympa.conf" >> $_log_file + perl -i -n -p -e "s#^(\s*\#\s*${_key}.*)#\1\n$_key\t$_val#" ${SYMPA_MAIN_CONF_DIR}/sympa.conf >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal "Cannot set \"$_key\" in file \"${SYMPA_MAIN_CONF_DIR}/sympa.conf\" .." + fi + + _key=db_passwd + _val="$SYMPA_DB_PASSWD" + echo "" >> $_log_file + echo "## - Set \"$_key\" in file ${SYMPA_MAIN_CONF_DIR}/sympa.conf .." >> $_log_file + echo "## -" >> $_log_file + echononl "\tSet \"$_key\" in file ${SYMPA_MAIN_CONF_DIR}/sympa.conf .." + echo "perl -i -n -p -e \"s#^(\s*\#\s*${_key}.*)#\1\n$_key\t$_val#\" ${SYMPA_MAIN_CONF_DIR}/sympa.conf" >> $_log_file + perl -i -n -p -e "s#^(\s*\#\s*${_key}.*)#\1\n$_key\t$_val#" ${SYMPA_MAIN_CONF_DIR}/sympa.conf >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal "Cannot set \"$_key\" in file \"${SYMPA_MAIN_CONF_DIR}/sympa.conf\" .." + fi + + _key=use_fast_cgi + _val=1 + echo "" >> $_log_file + echo "## - Set \"$_key\" in file ${SYMPA_MAIN_CONF_DIR}/sympa.conf .." >> $_log_file + echo "## -" >> $_log_file + echononl "\tSet \"$_key\" in file ${SYMPA_MAIN_CONF_DIR}/sympa.conf .." + echo "perl -i -n -p -e \"s#^(\s*\#\s*${_key}.*)#\1\n$_key\t$_val#\" ${SYMPA_MAIN_CONF_DIR}/sympa.conf" >> $_log_file + perl -i -n -p -e "s#^(\s*\#\s*${_key}.*)#\1\n$_key\t$_val#" ${SYMPA_MAIN_CONF_DIR}/sympa.conf >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal "Cannot set \"$_key\" in file \"${SYMPA_MAIN_CONF_DIR}/sympa.conf\" .." + fi + + _key=lang + _val="de" + echo "" >> $_log_file + echo "## - Set \"$_key\" in file ${SYMPA_MAIN_CONF_DIR}/sympa.conf .." >> $_log_file + echo "## -" >> $_log_file + echononl "\tSet \"$_key\" in file ${SYMPA_MAIN_CONF_DIR}/sympa.conf .." + echo "perl -i -n -p -e \"s#^(\s*\#\s*${_key}.*)#\1\n$_key\t$_val#\" ${SYMPA_MAIN_CONF_DIR}/sympa.conf" >> $_log_file + perl -i -n -p -e "s#^(\s*\#\s*${_key}.*)#\1\n$_key\t$_val#" ${SYMPA_MAIN_CONF_DIR}/sympa.conf >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal "Cannot set \"$_key\" in file \"${SYMPA_MAIN_CONF_DIR}/sympa.conf\" .." + fi + + echo "" >> $_log_file + echo "## - Add \"merge_feature\" to file ${SYMPA_MAIN_CONF_DIR}/sympa.conf .." >> $_log_file + echo "## -" >> $_log_file + echononl "\tAdd \"merge_feature\" to file ${SYMPA_MAIN_CONF_DIR}/sympa.conf .." + echo "cat << EOF > /etc/init.d/sympa +## merge_feature +## 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 + +## merge_feature +## 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 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Cannot set \"merge_feature\" in file \"${SYMPA_MAIN_CONF_DIR}/sympa.conf\" .." + fi + + ## - Set owner/group for \"sympa.conf\".. + ## - + echononl "\tSet owner/group for \"sympa.conf\".." + echo "" >> $_log_file + echo "## - Set owner/group for \"sympa.conf\".." >> $_log_file + echo "## -" >> $_log_file + echo "chown ${SYMPA_USER}:$SYMPA_GROUP ${SYMPA_MAIN_CONF_DIR}/sympa.conf" >> $_log_file + chown ${SYMPA_USER}:$SYMPA_GROUP ${SYMPA_MAIN_CONF_DIR}/sympa.conf >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fi + +fi + +echo +echo -e "\t---" +echo -e "\t--- Some after installation tasks" +echo -e "\t---" +echo"" + +echo "" >> $_log_file +echo -e "## ---" >> $_log_file +echo -e "## --- Some after installation tasks" >> $_log_file +echo -e "## ---" >> $_log_file +echo"" >> $_log_file + +## - Priovide LSB - Add Block for run-time dependencies on Sympa +## - +_backup_sympa_initscript=`mktemp` +_failed=false + +echo "" >> $_log_file +echo "## - Priovide LSB - Add Block for run-time dependencies to /etc/init.d/sympa .." >> $_log_file +echo "## -" >> $_log_file + +echononl "\tAdd Block for run-time dependencies to /etc/init.d/sympa .." +echo "cp /etc/init.d/sympa $_backup_sympa_initscript" >> $_log_file +cp /etc/init.d/sympa $_backup_sympa_initscript >> $_log_file 2>&1 +if [ "$?" != "0" ]; then + _failed=true +fi +echo "cat << EOF > /etc/init.d/sympa +#!/bin/sh + +### BEGIN INIT INFO +# Provides: sympa +# Required-Start: \\\$remote_fs \\\$syslog +# Required-Stop: \\\$remote_fs \\\$syslog +# Should-Start: mysql postgresql +# Should-Stop: mysql postgresql +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Short-Description: start and stop the SYMPA mailing list manager +# Description: SYMPA is a mailing list manager +### END INIT INFO + +export PERL5LIB=/usr/share/mhonarc + +EOF" >> $_log_file +cat << EOF > /etc/init.d/sympa +#!/bin/sh + +### BEGIN INIT INFO +# Provides: sympa +# Required-Start: \$remote_fs \$syslog +# Required-Stop: \$remote_fs \$syslog +# Should-Start: mysql postgresql +# Should-Stop: mysql postgresql +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Short-Description: start and stop the SYMPA mailing list manager +# Description: SYMPA is a mailing list manager +### END INIT INFO + +export PERL5LIB=/usr/share/mhonarc + +EOF +if [ "$?" != "0" ]; then + _failed=true +fi + +echo "tail -n +2 "$_backup_sympa_initscript" >> /etc/init.d/sympa" >> $_log_file +tail -n +2 "$_backup_sympa_initscript" >> /etc/init.d/sympa +if [ "$?" != "0" ]; then + _failed=true +fi + +echo "rm $_backup_sympa_initscript" >> $_log_file +rm $_backup_sympa_initscript >> $_log_file 2>&1 +if [ "$?" != "0" ]; then + _failed=true +fi +if $_failed ; then + echo_failed +else + echo_ok +fi + +if ! $UPDATE_SYMPA ; then + if $START_AT_BOOTTIME ; then + + if `ls /etc/rc2.d/ | grep sympa > /dev/null 2>&1` ; then + echononl "\tRemove init script links" + echo "" >> $_log_file + echo "## - Remove init script links" >> $_log_file + echo "## -" >> $_log_file + echo "update-rc.d -f sympa remove" >> $_log_file + + update-rc.d -f sympa remove >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + warn "Removing existing init script links failed." + fi + fi + + ## - Make Sympa mailing list manager start at boottime + ## - + if $SYSTEMD_EXISTS ; then + + echo "" >> $_log_file + echo "## - Eanbles sympa.service" >> $_log_file + echo "## -" >> $_log_file + echononl "\tEanbles sympa.service" + echo "systemctl enable sympa" >> $_log_file + systemctl enable sympa >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Create file /etc/systemd/system/sympa.service failed!" + fi + else + echononl "\tMake Sympa mailing list manager at boottime" + echo "" >> $_log_file + echo "## - Make Sympa mailing list manager at boottime" >> $_log_file + echo "## -" >> $_log_file + echo "update-rc.d sympa defaults" >> $_log_file + update-rc.d sympa defaults >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Making sympa start at boottime failed." + fi + fi # if $SYSTEMD_EXISTS + fi # if START_AT_BOOTTIME +fi # if $UPDATE_SYMPA + + +## - special for debian. set manpath entries +## - +if [ -f /etc/manpath.config ];then + echononl "\tSet manpath entries in /etc/manpath.config" + if ! grep $SYMPA_MANPATH /etc/manpath.config > /dev/null 2<&1 ; then + + echo "" >> $_log_file + echo "## - Set manpath entries in /etc/manpath.config" >> $_log_file + echo "## -" >> $_log_file + + echo "echo >> /etc/manpath.config" >> $_log_file + echo "echo \"MANDATORY_MANPATH $SYMPA_MANPATH /var/cache/man\" >> /etc/manpath.config" >> $_log_file + echo "echo \"MANPATH_MAP $SYMPA_BIN_DIR $SYMPA_MANPATH\" >> /etc/manpath.config" >> $_log_file + echo "echo \"MANDB_MAP $SYMPA_MANPATH /var/cache/man\" >> /etc/manpath.config" >> $_log_file + + echo >> /etc/manpath.config + echo "MANDATORY_MANPATH $SYMPA_MANPATH /var/cache/man" >> /etc/manpath.config + echo "MANPATH_MAP $SYMPA_BIN_DIR $SYMPA_MANPATH" >> /etc/manpath.config + echo "MANDB_MAP $SYMPA_MANPATH /var/cache/man" >> /etc/manpath.config + echo_ok + else + echo_skipped + fi +elif [ -f /etc/man.conf];then + echononl "\tSet manpath entries in /etc/man.conf" + if ! grep $SYMPA_MANPATH /etc/man.conf > /dev/null 2<&1 ; then + + echo "" >> $_log_file + echo "## - Set manpath entries in /etc/man.conf" >> $_log_file + echo "## -" >> $_log_file + + echo >> /etc/man.conf + echo "MANPATH $SYMPA_MANPATH /var/cache/man" >> /etc/man.conf + echo "MANPATH_MAP $SYMPA_BIN_DIR /opt/apache2/man" >> /etc/man.conf + echo_ok + else + echo_skipped + fi +fi + +## - Add ${PREFIX}/bin to the systems PATH variable +## - +_checkdir="${PREFIX}/bin" +if [ -f /etc/profile ]; then + echononl "\tAdd $_checkdir to the systems PATH variable.." + if ! grep -e "$_checkdir" /etc/profile > /dev/null 2<&1 ; then + + echo "" >> $_log_file + echo "## - Add $_checkdir to the systems PATH variable.." >> $_log_file + echo "## -" >> $_log_file + + echo "perl -i -n -p -e \"s#^([ ]*export[ ]*PATH.*$)#check_dir=$_checkdir\nif [ -d \\\"\\\\\$check_dir\\\" ];then\n PATH=\\\\\${check_dir}:\\\\\$PATH\nfi\n\n\1#\" /etc/profile > /dev/null 2<&1" >> $_log_file + + perl -i -n -p -e "s#^([ ]*export[ ]*PATH.*$)#check_dir=$_checkdir\nif [ -d \"\\\$check_dir\" ];then\n PATH=\\\${check_dir}:\\\$PATH\nfi\n\n\1#" /etc/profile > /dev/null 2<&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + warn "Adding $_checkdir to the systems PATH variable failed!" + fi + else + echo_skipped + fi +fi + + +echo +echo -e "\t---" +echo -e "\t--- Configure Apache Webserver" +echo -e "\t---" +echo"" + +echo "" >> $_log_file +echo -e "## ---" >> $_log_file +echo -e "## --- Configure Apache Webserver" >> $_log_file +echo -e "## ---" >> $_log_file +echo"" >> $_log_file + +if $UPDATE_SYMPA ; then + info "Configuration will be omitted. No webserver configuration needed in update mode." + + echo "" >> $_log_file + + echo "# --- Configuration will be omitted. No webserver configuration needed in update mode." >> $_log_file + echo "# ---" >> $_log_file + +else + + _apache_vhost_added=false + ## - Add VHost Configuration to Apache Webserver + ## - + echononl "\tAdd VHost Configuration for Apache Webserver.." + if grep -r $SYMPA_DOMAIN $apache_vhost_dir/* 2>/dev/null |\ + grep -q -i -E "(ServerAlias| ServerName)" 2> /dev/null ; then + echo_skipped + warn "Apache VHost Configuration for \"$SYMPA_DOMAIN\" already exists." + else + echo "" >> $_log_file + echo "## - Add VHost Configuration for Apache Webserver...." >> $_log_file + echo "## -" >> $_log_file + echo "cat < $apache_vhost_dir/${SYMPA_DOMAIN}.conf +# - $SYMPA_DOMAIN -# + + + + ServerAdmin admin@oopen.de + + ServerName $SYMPA_DOMAIN + + RewriteEngine on + RewriteCond %{HTTPS} !=on + RewriteRule (.*) https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L] + + CustomLog ${apache_log_dir}/${SYMPA_DOMAIN}-access.log combined + ErrorLog ${apache_log_dir}/${SYMPA_DOMAIN}-error.log + + + + + + ServerAdmin admin@oopen.de + + ServerName $SYMPA_DOMAIN + + RewriteEngine on + RewriteRule ^/\\\$ /$_wwsympa_dir/ [R] + + + AllowOverride none + Require all granted + + + + AllowOverride none + Require all granted + + + Alias /static-sympa ${PREFIX}/static_content + ScriptAlias /wws ${PREFIX}/bin/wwsympa-wrapper.fcgi + + + SetHandler fcgid-script + + + SSLEngine on + + ## - HTTP Strict Transport Security (HSTS) + ## - + ## - HSTS tells a browser that the website should only be accessed through + ## - a secure connection. The HSTS header will be remembered by a standard + ## compliant browser for max-age seconds. + ## - + ## - Remember this settings for 1/2 year + ## - + #Header add Strict-Transport-Security \"max-age=15768000\" + Header always set Strict-Transport-Security \"max-age=31536000; includeSubDomains\" + + ## - don't support weak ciphers + SSLHonorCipherOrder On + SSLCompression Off + SSLProtocol ALL -SSLv2 -SSLv3 + + SSLCertificateFile ${apache_conf_dir}/server-bundle.crt + SSLCertificateKeyFile ${apache_conf_dir}/server.key + + CustomLog ${apache_log_dir}/${SYMPA_DOMAIN}-access.log combined + ErrorLog ${apache_log_dir}/${SYMPA_DOMAIN}-error.log + + + + +## --- +## --- IPv6 +## --- + + + + ServerAdmin admin@oopen.de + + ServerName $SYMPA_DOMAIN + + RewriteEngine on + RewriteCond %{HTTPS} !=on + RewriteRule (.*) https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L] + + CustomLog ${apache_log_dir}/${SYMPA_DOMAIN}-access.log combined + ErrorLog ${apache_log_dir}/${SYMPA_DOMAIN}-error.log + + + + + + ServerAdmin admin@oopen.de + + ServerName $SYMPA_DOMAIN + + RewriteEngine on + RewriteRule ^/\\\$ /$_wwsympa_dir/ [R] + + + AllowOverride none + Require all granted + + + + AllowOverride none + Require all granted + + + Alias /static-sympa ${PREFIX}/static_content + ScriptAlias /wws ${PREFIX}/bin/wwsympa-wrapper.fcgi + + + SetHandler fcgid-script + + + SSLEngine on + + ## - HTTP Strict Transport Security (HSTS) + ## - + ## - HSTS tells a browser that the website should only be accessed through + ## - a secure connection. The HSTS header will be remembered by a standard + ## compliant browser for max-age seconds. + ## - + ## - Remember this settings for 1/2 year + ## - + #Header add Strict-Transport-Security \"max-age=15768000\" + Header always set Strict-Transport-Security \"max-age=31536000; includeSubDomains\" + + ## - don't support weak ciphers + SSLHonorCipherOrder On + SSLCompression Off + SSLProtocol ALL -SSLv2 -SSLv3 + + SSLCertificateFile ${apache_conf_dir}/server-bundle.crt + SSLCertificateKeyFile ${apache_conf_dir}/server.key + + CustomLog ${apache_log_dir}/${SYMPA_DOMAIN}-access.log combined + ErrorLog ${apache_log_dir}/${SYMPA_DOMAIN}-error.log + + +EOF" >> $_log_file + + cat < $apache_vhost_dir/${SYMPA_DOMAIN}.conf +# - $SYMPA_DOMAIN -# + + + + ServerAdmin admin@oopen.de + + ServerName $SYMPA_DOMAIN + + RewriteEngine on + RewriteCond %{HTTPS} !=on + RewriteRule (.*) https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L] + + CustomLog ${apache_log_dir}/${SYMPA_DOMAIN}-access.log combined + ErrorLog ${apache_log_dir}/${SYMPA_DOMAIN}-error.log + + + + + + ServerAdmin admin@oopen.de + + ServerName $SYMPA_DOMAIN + + RewriteEngine on + RewriteRule ^/\$ /$_wwsympa_dir/ [R] + + + AllowOverride none + Require all granted + + + + AllowOverride none + Require all granted + + + Alias /static-sympa ${PREFIX}/static_content + ScriptAlias /wws ${PREFIX}/bin/wwsympa-wrapper.fcgi + + + SetHandler fcgid-script + + + SSLEngine on + + ## - HTTP Strict Transport Security (HSTS) + ## - + ## - HSTS tells a browser that the website should only be accessed through + ## - a secure connection. The HSTS header will be remembered by a standard + ## compliant browser for max-age seconds. + ## - + ## - Remember this settings for 1/2 year + ## - + #Header add Strict-Transport-Security "max-age=15768000" + Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains" + + ## - don't support weak ciphers + SSLHonorCipherOrder On + SSLCompression Off + SSLProtocol ALL -SSLv2 -SSLv3 + + SSLCertificateFile ${apache_conf_dir}/server-bundle.crt + SSLCertificateKeyFile ${apache_conf_dir}/server.key + + CustomLog ${apache_log_dir}/${SYMPA_DOMAIN}-access.log combined + ErrorLog ${apache_log_dir}/${SYMPA_DOMAIN}-error.log + + + + +## --- +## --- IPv6 +## --- + + + + ServerAdmin admin@oopen.de + + ServerName $SYMPA_DOMAIN + + RewriteEngine on + RewriteCond %{HTTPS} !=on + RewriteRule (.*) https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L] + + CustomLog ${apache_log_dir}/${SYMPA_DOMAIN}-access.log combined + ErrorLog ${apache_log_dir}/${SYMPA_DOMAIN}-error.log + + + + + + ServerAdmin admin@oopen.de + + ServerName $SYMPA_DOMAIN + + RewriteEngine on + RewriteRule ^/\$ /$_wwsympa_dir/ [R] + + + AllowOverride none + Require all granted + + + + AllowOverride none + Require all granted + + + Alias /static-sympa ${PREFIX}/static_content + ScriptAlias /wws ${PREFIX}/bin/wwsympa-wrapper.fcgi + + + SetHandler fcgid-script + + + SSLEngine on + + ## - HTTP Strict Transport Security (HSTS) + ## - + ## - HSTS tells a browser that the website should only be accessed through + ## - a secure connection. The HSTS header will be remembered by a standard + ## compliant browser for max-age seconds. + ## - + ## - Remember this settings for 1/2 year + ## - + #Header add Strict-Transport-Security "max-age=15768000" + Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains" + + ## - don't support weak ciphers + SSLHonorCipherOrder On + SSLCompression Off + SSLProtocol ALL -SSLv2 -SSLv3 + + SSLCertificateFile ${apache_conf_dir}/server-bundle.crt + SSLCertificateKeyFile ${apache_conf_dir}/server.key + + CustomLog ${apache_log_dir}/${SYMPA_DOMAIN}-access.log combined + ErrorLog ${apache_log_dir}/${SYMPA_DOMAIN}-error.log + + +EOF + if [ "$?" = "0" ]; then + echo_ok + apache_vhost_added=true + else + echo_failed + fi + fi + + if $apache_vhost_added ; then + _apache_configtest=false + echononl "\tCheck Apache Configuration" + echo "" >> $_log_file + echo "## - Check Apache Configuration" >> $_log_file + echo "## -" >> $_log_file + echo "apachectl configtest" >> $_log_file + apachectl configtest >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + _apache_configtest=true + else + echo_failed + fi + + echononl "\tGraceful Restart Apache Webserver.." + if $_apache_configtest ; then + echo "" >> $_log_file + echo "## - Graceful Restart Apache Webserver.." >> $_log_file + echo "## -" >> $_log_file + echo "apachectl graceful" >> $_log_file + apachectl graceful >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + _apache_configtest=true + else + echo_failed + fi + else + echo_skipped + fi + fi +fi + +echo +echo -e "\t---" +echo -e "\t--- Configure Postfix for Sympa Support" +echo -e "\t---" +echo"" + +echo "" >> $_log_file +echo -e "## ---" >> $_log_file +echo -e "## --- Configure Postfix for Sympa Support" >> $_log_file +echo -e "## ---" >> $_log_file +echo"" >> $_log_file + +if $UPDATE_SYMPA ; then + info "Configuration will be omitted. No mailserver configuration needed in update mode." + + echo "" >> $_log_file + + echo "# --- Configuration will be omitted. Noimailserver configuration needed in update mode." >> $_log_file + echo "# ---" >> $_log_file + +else + + ## - Configure Postfix + ## - + if $SYMPA_SUPPORT_MULTIDOMAINS ; then + + info "Configure Postfix for Sympa Multidomain Support" + + ## - Relay Domains + ## - + _file_name=sympa_domains + _parameter_name=relay_domains + echononl "\tCreate (empty) file \"$_file_name\".." + echo "" >> $_log_file + echo "## - Add (empty) file \"$_file_name\" to conf directory \"$POSTFIX_CONF_DIR\".." >> $_log_file + echo "## -" >> $_log_file + if [ -f "${POSTFIX_CONF_DIR}/$_file_name" ];then + echo_skipped + echo "## - File \"$_file_name\" already exists" >> $_log_file + echo "## -" >> $_log_file + else + echo "touch ${POSTFIX_CONF_DIR}/$_file_name" >> $_log_file + touch ${POSTFIX_CONF_DIR}/$_file_name >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Craeting file \"${POSTFIX_CONF_DIR}/$_file_name\" failed!" + fi + fi + + echononl "\tCreate concerning db-file \"${POSTFIX_CONF_DIR}/${_file_name}.db\".." + echo "" >> $_log_file + echo "## - Create concerning db-file \"${POSTFIX_CONF_DIR}/${_file_name}.db\".." >> $_log_file + echo "## -" >> $_log_file + echo "postmap btree:${POSTFIX_CONF_DIR}/$_file_name" >> $_log_file + postmap btree:${POSTFIX_CONF_DIR}/$_file_name >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "\"postmap btree:${POSTFIX_CONF_DIR}/$_file_name\" failed!" + fi + + echononl "\tConfigure postfix parameter ${_parameter_name}.." + echo "" >> $_log_file + echo "## - Add entry for \"$_file_name\" to postfix parameter ${_parameter_name}.." >> $_log_file + echo "## -" >> $_log_file + if grep -e "${POSTFIX_CONF_DIR}/$_file_name" ${POSTFIX_CONF_DIR}/main.cf 2>> $_log_file \ + | grep -q -v -e"^#" 2>> $_log_file ; then + echo_skipped + echo "## - Postfix parameter \"$_parameter_name\" is already configured." >> $_log_file + echo "## -" >> $_log_file + info "Postfix parameter \"$_parameter_name\" is already configured." + else + if grep -q -e "^$_parameter_name" ${POSTFIX_CONF_DIR}/main.cf 2>> /dev/null ; then + echo "perl -i.bak -n -p -e \"s#(^${_parameter_name}.*)#\1\n btree:${POSTFIX_CONF_DIR}/${_file_name}#\" \\" >> $_log_file + echo " ${POSTFIX_CONF_DIR}/main.cf">> $_log_file + perl -i.bak -n -p -e "s#(^${_parameter_name}.*)#\1\n btree:${POSTFIX_CONF_DIR}/${_file_name}#" \ + ${POSTFIX_CONF_DIR}/main.cf >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Configure postfix main.cf for ${_file_name} failed!" + fi + else + cat <> ${POSTFIX_CONF_DIR}/main.cf + +# --- +# Added for Sympa Mailing Lists (suports multidomain) +# --- +$_parameter_name = + btree:${POSTFIX_CONF_DIR}/$_file_name +EOF + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Configure postfix main.cf for ${_file_name} failed!" + msg_postfix="$msg_postfix\t \033[37m\033[1m$_parameter_name =\n" + msg_postfix="$msg_postfix\t btree:${POSTFIX_CONF_DIR}/$_file_name\033[m\n\n" + echo "## - Add to ${POSTFIX_CONF_DIR}/main.cf:" >> $_log_file + echo "## -" >> $_log_file + echo "## - $_parameter_name =" >> $_log_file + echo "## - btree:${POSTFIX_CONF_DIR}/$_file_name" >> $_log_file + echo "## -" >> $_log_file + fi + + #echo_skipped + #warn "Parameter \"$_parameter_name\" was not found in postfix configuration file \"main.cf\"." + ##echo -e "\t Configure $_parameter_name manually. Add to ${POSTFIX_CONF_DIR}/main.cf:\n" + #msg_postfix="$msg_postfix\t \033[37m\033[1m$_parameter_name =\n" + #msg_postfix="$msg_postfix\t btree:${POSTFIX_CONF_DIR}/$_file_name\033[m\n\n" + #echo "## - Add to ${POSTFIX_CONF_DIR}/main.cf:" >> $_log_file + #echo "## -" >> $_log_file + #echo "## - $_parameter_name =" >> $_log_file + #echo "## - btree:${POSTFIX_CONF_DIR}/$_file_name" >> $_log_file + #echo "## -" >> $_log_file + fi + fi + + echo "" + + ## - Forward addresses (postmaster|abuse)@sympa-domain.tld) using virtual_alias_maps + ## - + _file_name=sympa_virtual_aliases + _parameter_name=virtual_alias_maps + echononl "\tCreate file \"$_file_name\".." + echo "" >> $_log_file + echo "## - Add (empty) file \"$_file_name\" to conf directory \"$POSTFIX_CONF_DIR\".." >> $_log_file + echo "## -" >> $_log_file + if [ -f ${POSTFIX_CONF_DIR}/$_file_name ];then + echo_skipped + echo "## - \"$_file_name\" already exists" >> $_log_file + echo "## -" >> $_log_file + else + #echo "touch ${POSTFIX_CONF_DIR}/$_file_name" >> $_log_file + #touch ${POSTFIX_CONF_DIR}/$_file_name >> $_log_file 2>&1 + echo "echo \"/^(.*)-owner\\\\@(.*)\$/ \$1+owner@\$2\"" >> $_log_file + echo "/^(.*)-owner\\@(.*)\$/ \$1+owner@\$2" > ${POSTFIX_CONF_DIR}/$_file_name + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Craeting file \"${POSTFIX_CONF_DIR}/$_file_name\" failed!" + fi + fi + + echononl "\tConfigure postfix parameter ${_parameter_name}.." + echo "" >> $_log_file + echo "## - Add entry for \"$_file_name\" to postfix parameter ${_parameter_name}.." >> $_log_file + echo "## -" >> $_log_file + if grep -e "${POSTFIX_CONF_DIR}/$_file_name" ${POSTFIX_CONF_DIR}/main.cf 2>> $_log_file \ + | grep -q -v -e"^#" 2>> $_log_file ; then + echo_skipped + info "Postfix parameter \"$_parameter_name\" is already configured." + echo "## - Postfix parameter \"$_parameter_name\" is already configured ." >> $_log_file + echo "## -" >> $_log_file + else + if grep -q -e "^$_parameter_name" ${POSTFIX_CONF_DIR}/main.cf 2>> /dev/null ; then + echo "perl -i -n -p -e \"s#(^${_parameter_name}.*$)#\1\n regexp:${POSTFIX_CONF_DIR}/$_file_name#\" \\" >> $_log_file + echo " ${POSTFIX_CONF_DIR}/main.cf" >> $_log_file + perl -i -n -p -e "s#(^${_parameter_name}.*)#\1\n regexp:${POSTFIX_CONF_DIR}/$_file_name#" \ + ${POSTFIX_CONF_DIR}/main.cf >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Configure postfix $_parameter_name for $_file_name failed!" + fi + else + if grep -q -e "^relay_domains" ${POSTFIX_CONF_DIR}/main.cf 2>> /dev/null ; then + echo "perl -i -n -p -e \"s#(^relay_domains.*)#$_parameter_name = \n regexp:${POSTFIX_CONF_DIR}/$_file_name\n\n\1#\" \\">> $_log_file 2>&1 + echo " ${POSTFIX_CONF_DIR}/main.cf" >> $_log_file + perl -i -n -p -e "s#(^relay_domains.*)#$_parameter_name = \n regexp:${POSTFIX_CONF_DIR}/$_file_name\n\n\1#" \ + ${POSTFIX_CONF_DIR}/main.cf >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Configure postfix $_parameter_name for $_file_name failed!" + fi + else + echo_skipped + warn "Parameter \"$_parameter_name\" was not found in postfix configuration file \"main.cf\"." + #echo -e "\t Configure $_parameter_name manually. Add to ${POSTFIX_CONF_DIR}/main.cf:\n" + msg_postfix="$msg_postfix\t \033[37m\033[1m$_parameter_name =\n" + msg_postfix="$msg_postfix\t regexp:${POSTFIX_CONF_DIR}/$_file_name\033[m\n\n" + echo "## - Add to ${POSTFIX_CONF_DIR}/main.cf:" >> $_log_file + echo "## -" >> $_log_file + echo "## - $_parameter_name =" >> $_log_file + echo "## - regexp:${POSTFIX_CONF_DIR}/$_file_name" >> $_log_file + echo "## -" >> $_log_file + fi + fi + fi + + + echo "" + + ## - Add transport for Sympa Domains to /etc/postfix/master.cf + ## - + echononl "\tAdd transport declaration for sympa domains to file master.cf" + if grep -q -e "^sympa\ " ${POSTFIX_CONF_DIR}/master.cf 2>> /dev/null ; then + echo_skipped + else + echo "" >> $_log_file + echo "## - Add transport declaration for sympa domains to file master.cf" >> $_log_file + echo "## -" >> $_log_file + echo "cat <> ${POSTFIX_CONF_DIR}/master.cf + +sympa unix - n n - - pipe + flags=FR user=sympa argv=${PREFIX}/bin/queue \\\${recipient} +sympabounce unix - n n - - pipe + flags=FR user=sympa argv=${PREFIX}/bin/bouncequeue \\\${user} +EOF" >> $_log_file + + cat <> ${POSTFIX_CONF_DIR}/master.cf + +sympa unix - n n - - pipe + flags=FR user=sympa argv=${PREFIX}/bin/queue \${recipient} +sympabounce unix - n n - - pipe + flags=FR user=sympa argv=${PREFIX}/bin/bouncequeue \${user} + +EOF + + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Adding transport declaration for sympa domains to \"${POSTFIX_CONF_DIR}/master.cf\" failed!" + fi + fi + + _parameter_name=sympa_destination_recipient_limit + _parameter_val=1 + echononl "\tConfigure postfix (specific) parameter ${_parameter_name}.." + echo "" >> $_log_file + echo "## - Add postfix parameter \"${_parameter_name} = ${_parameter_val}\".." >> $_log_file + echo "## -" >> $_log_file + if grep -e "${_parameter_name}" ${POSTFIX_CONF_DIR}/main.cf 2>> $_log_file \ + | grep -q -v -e"^#" 2>> $_log_file ; then + echo_skipped + info "Postfix parameter \"$_parameter_name\" is already configured." + echo "## - Postfix parameter \"$_parameter_name\" is already configured." >> $_log_file + echo "## -" >> $_log_file + else + if grep -q -e "^relay_domains" ${POSTFIX_CONF_DIR}/main.cf 2>> /dev/null ; then + echo "perl -i -n -p -e \"s#(^relay_domains.*)#$_parameter_name = ${_parameter_val}\n\n\1#\" \\" >> $_log_file 2>&1 + echo " ${POSTFIX_CONF_DIR}/main.cf" >> $_log_file + perl -i -n -p -e "s#(^relay_domains.*)#$_parameter_name = ${_parameter_val}\n\n\1#" \ + ${POSTFIX_CONF_DIR}/main.cf >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Configure postfix $_parameter_name for $_file_name failed!" + fi + else + echo_skipped + warn "Parameter \"$_parameter_name\" was not found in postfix configuration file \"main.cf\"." + #echo -e "\t Configure $_parameter_name manually. Add to ${POSTFIX_CONF_DIR}/main.cf:\n" + msg_postfix="$msg_postfix\t \033[37m\033[1m${_parameter_name} = ${_parameter_val}\033[m\n" + echo "## - Add to ${POSTFIX_CONF_DIR}/main.cf:" >> $_log_file + echo "## -" >> $_log_file + echo "## - $_parameter_name = $_parameter_val" >> $_log_file + echo "## -" >> $_log_file + fi + fi + + _parameter_name=sympabounce_destination_recipient_limit + _parameter_val=1 + echononl "\tConfigure postfix (specific) parameter ${_parameter_name}.." + echo "" >> $_log_file + echo "## - Add postfix parameter \"${_parameter_name} = ${_parameter_val}\".." >> $_log_file + echo "## -" >> $_log_file + if grep -e "${_parameter_name}" ${POSTFIX_CONF_DIR}/main.cf 2>> $_log_file \ + | grep -q -v -e"^#" 2>> $_log_file ; then + echo_skipped + info "Postfix parameter \"$_parameter_name\" is already configured." + echo "## - Postfix parameter \"$_parameter_name\" is already configured." >> $_log_file + echo "## -" >> $_log_file + else + if grep -q -e "^relay_domains" ${POSTFIX_CONF_DIR}/main.cf 2>> /dev/null ; then + echo "perl -i -n -p -e \"s#(^relay_domains.*)#$_parameter_name = ${_parameter_val}\n\n\1#\" \\" >> $_log_file 2>&1 + echo " ${POSTFIX_CONF_DIR}/main.cf" >> $_log_file + perl -i -n -p -e "s#(^relay_domains.*)#$_parameter_name = ${_parameter_val}\n\n\1#" \ + ${POSTFIX_CONF_DIR}/main.cf >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Configure postfix $_parameter_name for $_file_name failed!" + fi + else + echo_skipped + warn "Parameter \"$_parameter_name\" was not found in postfix configuration file \"main.cf\"." + #echo -e "\t Configure $_parameter_name manually. Add to ${POSTFIX_CONF_DIR}/main.cf:\n" + msg_postfix="$msg_postfix\t \033[37m\033[1m${_parameter_name} = ${_parameter_val}\033[m\n" + echo "## - Add to ${POSTFIX_CONF_DIR}/main.cf:" >> $_log_file + echo "## -" >> $_log_file + echo "## - $_parameter_name = $_parameter_val" >> $_log_file + echo "## -" >> $_log_file + fi + fi + + + ## - Configure Parameter "transport_maps" for Sympa domains + ## - + _file_name=sympa_transport + _parameter_name=transport_maps + echononl "\tCreate (empty) file \"$_file_name\".." + if [ -f ${POSTFIX_CONF_DIR}/$_file_name ];then + echo_skipped + else + echo "" >> $_log_file + echo "## - Add (empty) file \"$_file_name\" to conf directory \"$POSTFIX_CONF_DIR\".." >> $_log_file + echo "## -" >> $_log_file + echo "touch ${POSTFIX_CONF_DIR}/$_file_name" >> $_log_file + touch ${POSTFIX_CONF_DIR}/$_file_name >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Craeting file \"${POSTFIX_CONF_DIR}/$_file_name\" failed!" + fi + fi + + echononl "\tConfigure postfix parameter ${_parameter_name}.." + echo "" >> $_log_file + echo "## - Add entry for \"$_file_name\" to postfix parameter ${_parameter_name}.." >> $_log_file + echo "## -" >> $_log_file + if grep -e "${POSTFIX_CONF_DIR}/$_file_name" ${POSTFIX_CONF_DIR}/main.cf 2>> $_log_file \ + | grep -q -v -e"^#" 2>> $_log_file ; then + echo_skipped + info "Postfix parameter \"$_parameter_name\" is already configured." + echo "## - Postfix parameter \"$_parameter_name\" is already configured." >> $_log_file + echo "## -" >> $_log_file + else + if grep -q -e "^$_parameter_name" ${POSTFIX_CONF_DIR}/main.cf 2>> /dev/null ; then + echo "perl -i -n -p -e \"s#(^${_parameter_name}.*$)#\1\n regexp:${POSTFIX_CONF_DIR}/$_file_name#\" \\" >> $_log_file + echo " ${POSTFIX_CONF_DIR}/main.cf" >> $_log_file + perl -i -n -p -e "s#(^${_parameter_name}.*)#\1\n regexp:${POSTFIX_CONF_DIR}/$_file_name#" \ + ${POSTFIX_CONF_DIR}/main.cf >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Configure postfix $_parameter_name for $_file_name failed!" + fi + else + if grep -q -e "^relay_domains" ${POSTFIX_CONF_DIR}/main.cf 2>> /dev/null ; then + echo "perl -i -n -p -e \"s#(^relay_domains.*)#$_parameter_name = \n regexp:${POSTFIX_CONF_DIR}/$_file_name\n\n\1#\" \\" >> $_log_file 2>&1 + echo " ${POSTFIX_CONF_DIR}/main.cf" >> $_log_file + perl -i -n -p -e "s#(^relay_domains.*)#$_parameter_name = \n regexp:${POSTFIX_CONF_DIR}/$_file_name\n\n\1#" \ + ${POSTFIX_CONF_DIR}/main.cf >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Configure postfix $_parameter_name for $_file_name failed!" + fi + else + echo_skipped + warn "Parameter \"$_parameter_name\" was not found in postfix configuration file \"main.cf\"." + #echo -e "\t Configure $_parameter_name manually. Add to ${POSTFIX_CONF_DIR}/main.cf:\n" + msg_postfix="$msg_postfix\t \033[37m\033[1m$_parameter_name =\n" + msg_postfix="$msg_postfix\t regexp:${POSTFIX_CONF_DIR}/$_file_name\033[m\n" + echo "## - Add to ${POSTFIX_CONF_DIR}/main.cf:" >> $_log_file + echo "## -" >> $_log_file + echo "## - $_parameter_name =" >> $_log_file + echo "## - regexp:${POSTFIX_CONF_DIR}/$_file_name" >> $_log_file + echo "## -" >> $_log_file + fi + fi + fi + else + + info "Configure Postfix for Sympa Single Domain Support" + + ## - Sympa Alias File + ## - + _file_name=`basename $SYMPA_ALIAS_FILE` + _parameter_name=alias_maps + echononl "\tCreate (empty) file \"$_file_name\".." + echo "" >> $_log_file + echo "## - Add (empty) file \"$_file_name\" to conf directory \"$POSTFIX_CONF_DIR\".." >> $_log_file + echo "## -" >> $_log_file + if [ -f "${POSTFIX_CONF_DIR}/$_file_name" ];then + echo_skipped + echo "## - File \"$_file_name\" already exists" >> $_log_file + echo "## -" >> $_log_file + else + echo "touch ${POSTFIX_CONF_DIR}/$_file_name" >> $_log_file + touch ${POSTFIX_CONF_DIR}/$_file_name >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Craeting file \"${POSTFIX_CONF_DIR}/$_file_name\" failed!" + fi + fi + + echononl "\tCreate concerning db-file \"${POSTFIX_CONF_DIR}/${_file_name}.db\".." + echo "" >> $_log_file + echo "## - Create concerning db-file \"${POSTFIX_CONF_DIR}/${_file_name}.db\".." >> $_log_file + echo "## -" >> $_log_file + echo "postmap btree:${POSTFIX_CONF_DIR}/$_file_name" >> $_log_file + postmap btree:${POSTFIX_CONF_DIR}/$_file_name >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "\"postmap btree:${POSTFIX_CONF_DIR}/$_file_name\" failed!" + fi + + echononl "\tConfigure postfix parameter ${_parameter_name}.." + echo "" >> $_log_file + echo "## - Add entry for \"$_file_name\" to postfix parameter ${_parameter_name}.." >> $_log_file + echo "## -" >> $_log_file + if grep -e "${POSTFIX_CONF_DIR}/$_file_name" ${POSTFIX_CONF_DIR}/main.cf 2>> $_log_file \ + | grep -q -v -e"^#" 2>> $_log_file ; then + echo_skipped + echo "## - Postfix parameter \"$_parameter_name\" is already configured." >> $_log_file + echo "## -" >> $_log_file + info "Postfix parameter \"$_parameter_name\" is already configured." + else + if grep -q -e "^$_parameter_name" ${POSTFIX_CONF_DIR}/main.cf 2>> /dev/null ; then + echo "perl -i.bak -n -p -e \"s#(^${_parameter_name}.*)#\1\n btree:${POSTFIX_CONF_DIR}/${_file_name}#\" \\" >> $_log_file + echo " ${POSTFIX_CONF_DIR}/main.cf">> $_log_file + perl -i.bak -n -p -e "s#(^${_parameter_name}.*)#\1\n btree:${POSTFIX_CONF_DIR}/${_file_name}#" \ + ${POSTFIX_CONF_DIR}/main.cf >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Configure postfix main.cf for ${filename} failed!" + fi + else + cat <> ${POSTFIX_CONF_DIR}/main.cf + +# --- +# Added for Sympa Mailing Lists +# --- +${_parameter_name} = + btree:${POSTFIX_CONF_DIR}/$_file_name +EOF + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Configure postfix main.cf for ${_file_name} failed!" + msg_postfix="$msg_postfix\t \033[37m\033[1m$_parameter_name =\n" + msg_postfix="$msg_postfix\t btree:${POSTFIX_CONF_DIR}/$_file_name\033[m\n\n" + echo "## - Add to ${POSTFIX_CONF_DIR}/main.cf:" >> $_log_file + echo "## -" >> $_log_file + echo "## - $_parameter_name =" >> $_log_file + echo "## - btree:${POSTFIX_CONF_DIR}/$_file_name" >> $_log_file + echo "## -" >> $_log_file + fi + + fi + fi + + _parameter_name=alias_database + echononl "\tConfigure postfix parameter ${_parameter_name}.." + echo "" >> $_log_file + echo "## - Add entry for \"$_file_name\" to postfix parameter ${_parameter_name}.." >> $_log_file + echo "## -" >> $_log_file + #if grep -e "${POSTFIX_CONF_DIR}/$_file_name" ${POSTFIX_CONF_DIR}/main.cf 2>> $_log_file \ + # | grep -q -v -e"^#" 2>> $_log_file ; then + # echo_skipped + # echo "## - Postfix parameter \"$_parameter_name\" is already configured." >> $_log_file + # echo "## -" >> $_log_file + # info "Postfix parameter \"$_parameter_name\" is already configured." + #else + if grep -q -e "^$_parameter_name" ${POSTFIX_CONF_DIR}/main.cf 2>> /dev/null ; then + echo "perl -i.bak -n -p -e \"s#(^${_parameter_name}.*)#\1\n btree:${POSTFIX_CONF_DIR}/${_file_name}#\" \\" >> $_log_file + echo " ${POSTFIX_CONF_DIR}/main.cf">> $_log_file + perl -i.bak -n -p -e "s#(^${_parameter_name}.*)#\1\n btree:${POSTFIX_CONF_DIR}/${_file_name}#" \ + ${POSTFIX_CONF_DIR}/main.cf >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Configure postfix main.cf for ${filename} failed!" + fi + else + cat <> ${POSTFIX_CONF_DIR}/main.cf + +# --- +# Added for Sympa Mailing Lists +# --- +${_parameter_name} = + btree:${POSTFIX_CONF_DIR}/$_file_name +EOF + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Configure postfix main.cf for ${_file_name} failed!" + msg_postfix="$msg_postfix\t \033[37m\033[1m$_parameter_name =\n" + msg_postfix="$msg_postfix\t btree:${POSTFIX_CONF_DIR}/$_file_name\033[m\n\n" + echo "## - Add to ${POSTFIX_CONF_DIR}/main.cf:" >> $_log_file + echo "## -" >> $_log_file + echo "## - $_parameter_name =" >> $_log_file + echo "## - btree:${POSTFIX_CONF_DIR}/$_file_name" >> $_log_file + echo "## -" >> $_log_file + fi + + fi + #fi + + fi + + + ## - Reload postfix configuration + ## - + echononl "\tReload Postfix.." + echo "" >> $_log_file + echo "## - Reload Postfix.." >> $_log_file + echo "## -" >> $_log_file + if $SYSTEMD_EXISTS ; then + echo "systemctl reload postfix" >> $_log_file + systemctl reload postfix >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Reloading Postfix SMTP-Server failed!" + fi + else + echo "/etc/init.d/postfix reload" >> $_log_file + /etc/init.d/postfix reload >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Reloading Postfix SMTP-Server failed!" + fi + fi +fi + + +## - Start Sympa mailing list manager +## - + +echo "" +echo -e "\t---" +echo -e "\t--- Starting Sympa mailing list manager .." +echo -e "\t---" +echo"" + +echo "" >> $_log_file +echo "" >> $_log_file +echo "## ---" >> $_log_file +echo "## --- Starting Sympa mailing list manager .." >> $_log_file +echo "## ---" >> $_log_file +echo "" >> $_log_file +if $SYSTEMD_EXISTS ; then + + echononl "\tReload systemd configuration" + echo "systemctl daemon-reload" >> $_log_file + systemctl daemon-reload >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Reloading systemd configuration failed!" + fi + + if $UPDATE_SYMPA ; then + echononl "\tRestarting Sympa mailing list manager .." + echo "" >> $_log_file + echo "systemctl restart sympa" >> $_log_file + systemctl restart sympa >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Restarting Sympa mailing list manager failed!" + fi + else + echononl "\tStarting Sympa mailing list manager .." + echo "" >> $_log_file + echo "systemctl start sympa" >> $_log_file + systemctl start sympa >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Starting Sympa mailing list manager failed!" + fi + fi + +else + if $UPDATE_SYMPA ; then + echononl "\tRestarting Sympa mailing list manager .." + echo "" >> $_log_file + echo "${SYMPA_INIT_DIR}/sympa restart" >> $_log_file + ${SYMPA_INIT_DIR}/sympa restart >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Restarting Sympa mailing list manager failed!" + fi + else + echononl "\tStarting Sympa mailing list manager .." + echo "" >> $_log_file + echo "${SYMPA_INIT_DIR}/sympa start" >> $_log_file + ${SYMPA_INIT_DIR}/sympa start >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Starting Sympa mailing list manager failed!" + fi + fi +fi + +if $UPDATE_SYMPA ; then + + echononl "\tStart Apache Webserver" + echo "" >> $_log_file + echo "## - Start Apache Webserver.." >> $_log_file + echo "## -" >> $_log_file + if $SYSTEMD_EXISTS ; then + echo "systemctl start apache2" >> $_log_file + systemctl start apache2 >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + _apache_configtest=true + else + echo_failed + fi + + else + echo "$APACHE_INIT_SCRIPT start" >> $_log_file + $APACHE_INIT_SCRIPT start >> $_log_file 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fi + fi +fi + + + +echo "" +echo "" +echo -e "\t[ \033[33m\033[1mImportant\033[m ]: Take care, that all needed perl modules are installed!" +echo " You can check this by running \"$SYMPA_BIN_DIR/sympa_wizard.pl --check\"." +echo " Running this script allows you, to install missing modules." + +if $UPDATE_SYMPA ; then + echo "" + echo -e "\t[ \033[33m\033[1mImportant\033[m ]: For changes which are not compartible with previous versions," + echo " see file \"${_builddir}/NEWS\"." + echo " See \"${_builddir}/ChangeLog\" for the full changes log." + echo "" +fi +if [ -n "$msg_postfix" ]; then + echo "" + echo -e "\t[ \033[33m\033[1mImportant\033[m ]: To support multidomains, you have to add the following entries" + echo " to postfix configuration \"${POSTFIX_CONF_DIR}/main.cf\":" + echo "" + echo -e "$msg_postfix" +fi + +echo "" +exit diff --git a/oopen-logo_weiss.png b/oopen-logo_weiss.png new file mode 100644 index 0000000000000000000000000000000000000000..44c7ed8e150911315e0301852dda1625ab7faf90 GIT binary patch literal 4776 zcmZ8lcT^Kk7hQ@1A|V1wmtv66yL6CVgS1eDpi-ns4NZDgDFK5(Xb}Vfi2~9kbdVq- zH54H#O}c<|>0f^Te!FLO&diyaeeb;c?z?9aO-=L|u5erd0D!?jU)!AAXOWvOEhYK; z263EA?k+nT>1hKO|GkB+Wv|FHbiVqwNB|JO^5$#0%HWrd5=i8&y=8 z(|Zcl1?ad88#56=VtrXOL=t9O01PgrychgP@34^OaLer>y0&Mrk7;2{^3f|S*i41lF;#q-hj z;{mJqNCL`OBimE{N%21|waFg2fuQ&Z)@9)3%AawXqNKNB-IbAV8IU|UvQ{a%4*^*qlA4lbE(6sBAB%2{Ph47ma@|gK z+39j2sT>lGho9|~foK_TO>2~~@##>GEMkHA!F{|x!`*z%(T!MHhi7<1P-HRy_$j{N z{T^h7VHQQ`C+IWzy*qe}C>&dCk=>J4g9etZeq|@eh%gH3`?$t_&vQZ={Cl;%M+VBi z%no!CEgxhw!rEg7-Q8QVi05gHKiE{F{BtAXvpQn`47}rjwKQ=4^h(k^0_=S&`b6 zlI(MbMY#~XHbkJ(T@+ojK?xE?>z5@Mn@mT708w-u62%2%=f~ThDr$*A03g29C>E?4 zT^d*bv0!b&Rp!5M`|A5lYx>==6@>&5$KE(qiiwk)^an592X)!^Yh?fbz`OAF;Fas3 zj+lFbft5(}1f&H%A1rMbUzJ;kE}5DaG|Kw?{x%F?TTVd&yZ|*V*07qXLmZaZ6UPs8 zA`WR84|TKUIVOTVFjnKE8JElq>G<-IgzW9+lMomMZ;bI?XWG04prli008cR*8kg@~$|`!HjOdf-(;_K@8F%2stCd zcAqnoz^t#rO9K%jnYfoyCec8L8+6Z$)TAztHO@ccXDfIS-xbUIQ9J#76>3qRB#@ji z{Jm>rkTh}bKUL$BemC$^?o@!}KIEsW>cGWG*#x1=ZD>-JRUDdB)NjPnlR(dEm~M$c zwE8c86)?&&HAD@Sb8U@-gCnWOk-X&{KMt3bk-@^ss?3#|=Z!CK zXlN)cy=*(0nTd=%{kLr+`t03`sKBef>FH@aUI|7t$yXTp{#`**GMe7=SIg6WjKoZx zJMr{r7X}@?s%Zx9dNbU9b{>opRO2kjE;ON$ylqZl%a^h955o7`*n;_mrjs5iD&lnH z$IA*?bD(3{2+++<&0 zUvJm&L_{8&HZ&sQ?;_TJ|uAZaH)olE&3-Gy|742O}!&8 z&!ZIJ)|<-BDeo;?lr0v&GJc$1&B}PL_d>)0(_HxRrA%d>m3@&-{cQs#Uz2=qkO~`D z#4cmIdiz=`>rqwBq~>0|U|j3P&enzTPm@L>d?mo2(6L%G!KAPi7GXs0$Gy@MPa9Bf{!y%m{R4h&OR{%?Z>8F5ks zHm4Ucy$jnRD&)|4`S?u2X~Ix2GZqc-!PbnrwDkOb=ye?_bHa8J)PInZgCiwngVb16 zTwMI=lMR>}l2FUZ=S*a<-3e_?NJ!ub|JxZuMHBGR%hq2B3xmPPArTQ4HiwUYPRHR^ zT+~nhYB{AC)&|4?!#{q6pZ~EfAiaNw>*IIS<^>DW#tJ!it*WLkd>JWTv%F?$wY2wL zupos-3uI7p*~fxN7b`b$*NaR6dZ}D}&ZTsZQWzK+Z<(y}bC(gPh(zY(p5dYTy1IO& zz^_|}B1w+ZI)yz}EIM#Fv-JydGMZ^=b+4?v+r0GQnO^$a%1Ut$keAmW=2u8Ten~0_f1`BNsZ{?;oSrK?h@c$cFcWvhzZ)Al=UPx?mG&;7_})Zx(;si~U?i^ta@2b8xhU zY!{7$v9CUvt}Dmkt^lE-p=u|8WGtdncdk6|rlO*P!{MtLDPX3wUaW~LFPQducZyW8 z>*(V3(`B!eD`VyGwsofT1p} zL5X?B=v`h(MMXs^sk!ZtCjyd6N=j6;F;v&$6KzB}P`U95YV8W(f6r%5OFI^CGH^qW zNHj|yU2P-E1>$U^P{Qu)>;$e) zjI0KcbC*jk{JWAw35$*oJ>THsc1Y0HFNC$V{GB@uJ~M3=WhPDb;_oMtiWK6wglIrT zV3h7PO(NAh+UzeM;%DuL=5fp$lo%^Skl z7KCfDvT>pTeGY!#QZ}s|uV#X7Mhv}HEO^?(j$STT=n=;TF$iA&@i;WU14l6_UUT)9 zt5l+jh50JK0hUF0yWZE0#XT!P`%As215IuzDkWvsWMpAGzI)Er-c^yd>ZB6`G3b2g zdvdTr7^udSbgBR#uZ;nT*>tQ`|z$&Rkuz7dAM-R%OYaJi)ZQd z@g!`Cx5etD9BRl5{$B6NS|Ypapbv+) k9rj+HLk07oq?Y`fHd}TF|Db;F$4D}d zOa+ZOA4?ww`0G7r38LYX*X517R^B#HrarqkAw=7RD}e(rtXTtpG7!!o^G(Clkam0o zcF2U|sl7%0O@aeAP&D#R?)vk*FQ=!cQ_o(40qF7g?X>{F^=^usW;EiRy!-ftKdh9yQVU?a#D>tJAmC z`9yQ+oF7fdvhw>hX|`+Y>klH27T1{u^-FYs4mr+MqY{d2@!OJ9&xK6OEcR_I4C&_B z6Lc;Kr|retwWU)hdJ0pZ<8-NU9>N2dx3MkX9OYhLwMnLa9FH=Ahd& z%PslQk`oK2hRliaMbJqvi$@W=$!2}Don1=AM2^?eX;&E!5BA~TL|!RSL{HSZR?K&3 z&(HTHZ?{wWCEwNND~P)jNGVEd&sjW{Om#!t-c41odv%&bs!pPw`bRFLAErcQZIf?^ z8L}$R_Wckn2sgK~Y6#h$&&tXomfZ_$b+F?_Yx07jVqzN`8**9LxhvV(*=#&K62ih= zog;3RSuO_Y#x7~>Af?C3`Fx+*EDQI^%ta{-7a3nTAb2z1M9Es};FG?K3k(qLXN(hSG@JUZ%B! zZF{8ZvI<&1U*)MknF<5i(vm;Def#_Qch;SZF8DwOz(V~7kH?pk^ek*=Pd0a7L+Pqt z%+t@m{BmhvBd9F7<-Mmz&7KKzc_2?cD$?2-0Ml0 z=x>OA0e2Rg6c?iP@w*XN&A`Aw3yW9vZT+hOWIxD4#0f)Oty@fzYVe)wvVA^GXjEj) zG(aY!aES#o5r;nsN=RbT!BO~AP}$^qJqS##k+rzCwuZwAm*T8bZR8k$i3&T6KIDUI zJG6$3=F`(~On>PImNL8A$0)HzLY8649+SFVwMXvKerVuHyWaw#rA5UP4J`lI2s$}C z@A~i26p2(KiC9%GLX{()dKCxE+|fnQ z!(>e(1|x2DZEZK-H$29Be!HqzpY~wX?U;B^J>q1e zktVKFn?L59orf^CHzf5G+P{;^t-SeZ0i;?g5D(_PE0l9il|eZ>V{u1NUHzg2;~*?9 z4oc8WDq`y^%`<_I>qCm7q>v0oqBlq_Pj{a&aO&#n?s>KY%cyU2HMYnIdP%y0y-SA8TrM`UDGPr(D--vxmFxrQF({Av`J)TWO$=LB7Ud z4yQexk#QxK!Wh+0eGLo}$A3%- z&({vA+1cBN|DEl0lf_|3yq)Rk=~(69UqK`txk~nc?B#U%y`KL-v}@ z8kjna?s!goc>1@Krn(5+WC&q`szzYxV!>&>sAf>hlLVJU0{$#SrIO=x0Owe|g*+cdhee#w2zTmwaqB-$4!Wk^>EIIRa(F=$t?OJhE0U|KdpOIad6RvY7gfOjnL z{^l*<(o|E+o)xyx!!Q&16?|?SdCkOx9tl3rF4$P!c38>3@$2tK84ub~_X-g~hneC#R<^YrlOdXi-(XHjnH;v#T!c9DGP zV6TA0=IskeOvI^%S0_i-I&6(IGAk_OaPzDcYnARC2b3MNv$MZi!%(guf zp0D(?<(L%~;D7(0R`xd8l6SK?R~jolPogG56mr^q^K!^{N`QfmiFT#t!`S};Hdi$9 literal 0 HcmV?d00001 diff --git a/oopen_favicon.ico b/oopen_favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..842fb7ef5f63750d40b09a10999cbd769109ad75 GIT binary patch literal 1406 zcmZQzU<5(|0R|w+!H~hqz#zuJz@P!dKp_SNAO?wJ07i(&|Ns9P?6hZNNRJAPhQMeD xjF=FBmIiSD;^u>7Km`tj2C>ok5Ltv8YVeWmfZ2_mhPVji5ttv)X^T1y}$8 literal 0 HcmV?d00001