From 70e4b8ee3f87958df5476bed62eb8c486f8d86cd Mon Sep 17 00:00:00 2001 From: Christoph Kuchenbuch Date: Sat, 28 Apr 2018 01:17:41 +0200 Subject: [PATCH] install_sympa.sh: Fix error in detecting apache2 systemd service file. Add 'password_hash bcrypt'. Change Output of install script. --- install_sympa.sh | 272 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 195 insertions(+), 77 deletions(-) diff --git a/install_sympa.sh b/install_sympa.sh index 7c08743..45f6d6e 100755 --- a/install_sympa.sh +++ b/install_sympa.sh @@ -152,7 +152,7 @@ echononl(){ fatal(){ echo "" - echo -e "[ \033[31m\033[1mError\033[m ]: $*" + echo -e "\t[ \033[31m\033[1mError\033[m ]: $*" echo "" echo -e "\t\033[31m\033[1mInstalllation is canceled\033[m\033[m" echo "" @@ -282,11 +282,11 @@ if $SYSTEMD_SUPPORTED ; then # - Is Service exclusive controlled by systemd # - if systemctl -t service list-unit-files \ - | grep -e "^mysql" \ - | grep -q enabled 2> /devnull ; then + | grep -e "^apache2" \ + | grep -q -E "(enabled|disabled|generated)" 2> /devnull ; then APACHE_SERVICE_FILE=$(systemctl -t service list-unit-files \ - | grep -e "^apache" \ + | grep -e "^apache2" \ | awk '{print$1}') fi fi @@ -1484,16 +1484,14 @@ if [ ! -f sympa-${SYMPA_VERSION}.tar.gz ]; then echo "" >> $_log_file echo "## - Get source sympa-${SYMPA_VERSION}.tar.gz .." >> $_log_file echo "## -" >> $_log_file - # - OLD - #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 echo "wget https://github.com/sympa-community/sympa/releases/download/${SYMPA_VERSION}/sympa-${SYMPA_VERSION}.tar.gz" >> $_log_file wget https://github.com/sympa-community/sympa/releases/download/${SYMPA_VERSION}/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!" + fatal "Download of \"sympa-${SYMPA_VERSION}.tar.gz\" failed! \n + See '$_log_file' for further informations." fi else echo_skipped @@ -1514,6 +1512,8 @@ if ! $UPDATE_SYMPA ; then echo_ok else echo_failed + error "Adding group '$SYMPA_GROUP' failed! \n + See '$_log_file' for further informations." fi else echo_skipped @@ -1537,6 +1537,8 @@ if ! $UPDATE_SYMPA ; then echo_ok else echo_failed + error "Adding user '$SYMPA_USER' failed! \n + See '$_log_file' for further informations." fi else echo_skipped @@ -1560,7 +1562,8 @@ if ! $UPDATE_SYMPA ; then echo_ok else echo_failed - error "Creation of dir \"$_dir\" failed!" + error "Creation of dir \"$_dir\" failed! \n + See '$_log_file' for further informations." _create_dir=false fi else @@ -1574,12 +1577,13 @@ if ! $UPDATE_SYMPA ; then echo "## -" >> $_log_file if [ ! -f "$SYMPA_ALIAS_FILE" ]; then echo "touch $SYMPA_ALIAS_FILE" >> $_log_file - touch $SYMPA_ALIAS_FILE >> $_log_file + touch $SYMPA_ALIAS_FILE >> $_log_file 2>&1 if [ "$?" = "0" ]; then echo_ok else echo_failed - error "Creation of alias file \"$SYMPA_ALIAS_FILE\" failed!" + error "Creation of alias file \"$SYMPA_ALIAS_FILE\" failed! \n + See '$_log_file' for further informations." fi else echo_skipped @@ -1592,24 +1596,26 @@ if ! $UPDATE_SYMPA ; then 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 + chgrp $SYMPA_GROUP $SYMPA_ALIAS_FILE >> $_log_file 2>&1 if [ "$?" = "0" ]; then echo_ok else echo_failed - error "Cannot set ownerchip ($SYMPA_USER:$SYMPA_GROUP) to \"$SYMPA_ALIAS_FILE\"!" + error "Cannot set ownerchip ($SYMPA_USER:$SYMPA_GROUP) to \"$SYMPA_ALIAS_FILE\"! \n + See '$_log_file' for further informations." 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 + chmod 664 $SYMPA_ALIAS_FILE >> $_log_file 2>&1 if [ "$?" = "0" ]; then echo_ok else echo_failed - error "Cannot set ownerchip ($SYMPA_USER:$SYMPA_GROUP) to \"$SYMPA_ALIAS_FILE\"!" + error "Cannot set ownerchip ($SYMPA_USER:$SYMPA_GROUP) to \"$SYMPA_ALIAS_FILE\"! \n + See '$_log_file' for further informations." fi @@ -1644,7 +1650,8 @@ if ! $UPDATE_SYMPA ; then echo_ok else echo_failed - fatal "Installing debian package \"$_debian_pkg\" failed!" + fatal "Installing debian package \"$_debian_pkg\" failed! \n + See '${_logdir}/debian-install.log' for further informations." fi else echo_skipped @@ -1716,7 +1723,6 @@ 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 @@ -1764,7 +1770,8 @@ EOF echo_ok else echo_failed - error "Generating locales from \"/etc/locale.gen\" failed!" + error "Generating locales from \"/etc/locale.gen\" failed! \n + See '${_logdir}/debian-install.log' for further informations." fi echononl "\tAdd Environment Variable \"PERL5LIB\" to /etc/profile .." @@ -1773,12 +1780,13 @@ EOF 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 + echo "export PERL5LIB=/usr/share/mhonarc" >> /etc/profile 2>> $_log_file if [ "$?" = 0 ]; then echo_ok else echo_failed - error "Adding Environment Variable \"PERL5LIB\" to /etc/profile failed!" + error "Adding Environment Variable \"PERL5LIB\" to /etc/profile failed! \n + See '${_logdir}/debian-install.log' for further informations." fi else echo_skipped @@ -1807,13 +1815,15 @@ else echononl "\tStopping Apache Webserver .." _PID=`ps aux | grep "$HTTPD " | grep -e "^root" | grep -v grep | awk '{print$2}'` if [ -n "$_PID" ];then - if $SYSTEMD_SUPPORTED ; then + if [[ -n "$APACHE_SERVICE_FILE" ]] ; then echo "systemctl stop $APACHE_SERVICE_FILE" >> $_log_file systemctl stop $APACHE_SERVICE_FILE >> $_log_file 2>&1 if [ "$?" = "0" ]; then echo_ok else echo_failed + error "Stopping Apache Webserver (systemd service) failed! \n + See '${_log_file}' for further informations." fi else echo "$APACHE_INIT_SCRIPT stop" >> $_log_file @@ -1822,6 +1832,8 @@ else echo_ok else echo_failed + error "Stopping Apache Webserver (SysV Initscript) failed! \n + See '${_log_file}' for further informations." fi fi else @@ -1852,6 +1864,8 @@ else echo_ok else echo_failed + error "Stopping Sympa mailing list manager (systemd service) failed! \n + See '${_log_file}' for further informations." fi else echo "${SYMPA_INIT_DIR}/sympa stop" >> $_log_file @@ -1860,11 +1874,15 @@ else echo_ok else echo_failed + error "Stopping Sympa mailing list manager (SysV Initscript) failed! \n + See '${_log_file}' for further informations." fi fi else echo_skipped fi + + sleep 5 _PIDS=`ps -e f | grep ${PREFIX}/bin/ 2>/dev/null | grep -v grep | awk '{print$1}'` if [ -n "$_PIDS" ]; then @@ -1884,7 +1902,8 @@ else echo_ok else echo_failed - error "Cannot Backup existing installation directory \"$PREFIX\"!" + error "Cannot Backup existing installation directory \"$PREFIX\"! \n + See '${_log_file}' for further informations." _proceed="" echononl "Type uppercase \"yes\" to proceed anyway: " @@ -1902,7 +1921,8 @@ else echo_ok else echo_failed - error "Cannot Backup existing lists data directory \"$PREFIX\"!" + error "Cannot Backup existing lists data directory \"$PREFIX\"! \n + See '${_log_file}' for further informations." _proceed="" echononl "Type uppercase \"yes\" to proceed anyway: " @@ -1915,14 +1935,14 @@ else 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.${backup_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}-${backup_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}.${backup_date}.sql 2>> $_log_file + echo "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}.${backup_date}.sql" >> $_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}.${backup_date}.sql 2>> $_log_file if [ "$?" = "0" ]; then echo_ok else echo_failed - error "Cannot Backup existing database \"$SYMPA_DB_NAME\"!" + error "Cannot Backup existing database \"$SYMPA_DB_NAME\"! \n + See '${_log_file}' for further informations." _proceed="" echononl "Type uppercase \"yes\" to proceed anyway: " @@ -1947,7 +1967,8 @@ else echo_ok else echo_failed - error "Cannot Backup existing init script \"${SYMPA_INIT_DIR}/sympa\"!" + error "Cannot Backup existing init script \"${SYMPA_INIT_DIR}/sympa\"! \n + See '${_log_file}' for further informations." _proceed="" echononl "Type uppercase \"yes\" to proceed anyway: " @@ -1982,7 +2003,8 @@ if [ -d "$_builddir" ];then echo_ok else echo_failed - fatal "Cannot move (backup) source directory \"${_builddir}\" .." + fatal "Cannot move (backup) source directory \"${_builddir}\"! \n + See '${_log_file}' for further informations." fi else echo_skipped @@ -2006,7 +2028,8 @@ if [ "$?" = "0" ]; then echo_ok else echo_failed - fatal "Cannot unpack archive sympa-${SYMPA_VERSION}.tar.gz .." + fatal "Cannot unpack archive 'sympa-${SYMPA_VERSION}.tar.gz'! \n + See '${_log_file}' for further informations." fi @@ -2044,7 +2067,8 @@ if [ "$?" = "0" ]; then echo_ok else echo_failed - fatal "Configuring sympa-${SYMPA_VERSION} failed!" + fatal "Configuring sympa-${SYMPA_VERSION} failed! \n + See '${_logdir}/sympa-configure.log' for further informations." fi @@ -2060,7 +2084,8 @@ if [ "$?" = "0" ]; then echo_ok else echo_failed - fatal "Compiling sympa-${SYMPA_VERSION} failed!" + fatal "Compiling sympa-${SYMPA_VERSION} failed! \n + See '${_logdir}/sympa-make.log' for further informations." fi ## - Notice! @@ -2080,7 +2105,8 @@ if ! $UPDATE_SYMPA ; then echo_ok else echo_failed - fatal "Cannot move (backup) existing install directory \"${_builddir}\" .." + fatal "Cannot move (backup) existing install directory \"${_builddir}\"! \n + See '${_log_file}' for further informations." fi else echo_skipped @@ -2128,7 +2154,18 @@ if $UPDATE_SYMPA ; then echo_ok else echo_failed - error "\"${SYMPA_BIN_DIR}/sympa.pl --upgrade\" failed!" + error "\"${SYMPA_BIN_DIR}/sympa.pl --upgrade\" failed! \n + See '${_log_file}' for further informations." + + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Abbruch durch User" + fi if $SYSTEMD_SUPPORTED ; then @@ -2142,7 +2179,8 @@ if $UPDATE_SYMPA ; then echo_ok else echo_failed - error "Reloading systemd configuration failed!" + error "Reloading systemd configuration failed! \n + See '${_log_file}' for further informations." fi fi @@ -2159,7 +2197,8 @@ else echo_ok else echo_failed - fatal "Installing Sympa mailing list server (v ${SYMPA_VERSION}) failed!" + fatal "Installing Sympa mailing list server (v ${SYMPA_VERSION}) failed! \n + See '${_logdir}/sympa-make_install.log' for further informations." fi fi @@ -2207,7 +2246,8 @@ else echo_ok else echo_failed - fatal "Cannot set \"$_key\" in file \"${SYMPA_MAIN_CONF_DIR}/sympa.conf\" .." + fatal "Cannot set \"$_key\" in file \"${SYMPA_MAIN_CONF_DIR}/sympa.conf\"! \n + See '${_log_file}' for further informations." fi ## - Replace "@" with "\@" @@ -2227,7 +2267,8 @@ else echo_ok else echo_failed - fatal "Cannot set \"$_key\" in file \"${SYMPA_MAIN_CONF_DIR}/sympa.conf\" .." + fatal "Cannot set \"$_key\" in file \"${SYMPA_MAIN_CONF_DIR}/sympa.conf\"! \n + See '${_log_file}' for further informations." fi _key=wwsympa_url @@ -2242,7 +2283,8 @@ else echo_ok else echo_failed - fatal "Cannot set \"$_key\" in file \"${SYMPA_MAIN_CONF_DIR}/sympa.conf\" .." + fatal "Cannot set \"$_key\" in file \"${SYMPA_MAIN_CONF_DIR}/sympa.conf\"! \n + See '${_log_file}' for further informations." fi _key=home @@ -2257,7 +2299,8 @@ else echo_ok else echo_failed - fatal "Cannot set \"$_key\" in file \"${SYMPA_MAIN_CONF_DIR}/sympa.conf\" .." + fatal "Cannot set \"$_key\" in file \"${SYMPA_MAIN_CONF_DIR}/sympa.conf\"! \n + See '${_log_file}' for further informations." fi _key=db_type @@ -2272,7 +2315,8 @@ else echo_ok else echo_failed - fatal "Cannot set \"$_key\" in file \"${SYMPA_MAIN_CONF_DIR}/sympa.conf\" .." + fatal "Cannot set \"$_key\" in file \"${SYMPA_MAIN_CONF_DIR}/sympa.conf\"! \n + See '${_log_file}' for further informations." fi _key=db_name @@ -2287,7 +2331,8 @@ else echo_ok else echo_failed - fatal "Cannot set \"$_key\" in file \"${SYMPA_MAIN_CONF_DIR}/sympa.conf\" .." + fatal "Cannot set \"$_key\" in file \"${SYMPA_MAIN_CONF_DIR}/sympa.conf\"! \n + See '${_log_file}' for further informations." fi _key=db_host @@ -2302,7 +2347,8 @@ else echo_ok else echo_failed - fatal "Cannot set \"$_key\" in file \"${SYMPA_MAIN_CONF_DIR}/sympa.conf\" .." + fatal "Cannot set \"$_key\" in file \"${SYMPA_MAIN_CONF_DIR}/sympa.conf\"! \n + See '${_log_file}' for further informations." fi _key=db_port @@ -2317,7 +2363,8 @@ else echo_ok else echo_failed - fatal "Cannot set \"$_key\" in file \"${SYMPA_MAIN_CONF_DIR}/sympa.conf\" .." + fatal "Cannot set \"$_key\" in file \"${SYMPA_MAIN_CONF_DIR}/sympa.conf\"! \n + See '${_log_file}' for further informations." fi _key=db_user @@ -2332,7 +2379,8 @@ else echo_ok else echo_failed - fatal "Cannot set \"$_key\" in file \"${SYMPA_MAIN_CONF_DIR}/sympa.conf\" .." + fatal "Cannot set \"$_key\" in file \"${SYMPA_MAIN_CONF_DIR}/sympa.conf\"! \n + See '${_log_file}' for further informations." fi _key=db_passwd @@ -2347,7 +2395,8 @@ else echo_ok else echo_failed - fatal "Cannot set \"$_key\" in file \"${SYMPA_MAIN_CONF_DIR}/sympa.conf\" .." + fatal "Cannot set \"$_key\" in file \"${SYMPA_MAIN_CONF_DIR}/sympa.conf\"! \n + See '${_log_file}' for further informations." fi _key=use_fast_cgi @@ -2362,7 +2411,8 @@ else echo_ok else echo_failed - fatal "Cannot set \"$_key\" in file \"${SYMPA_MAIN_CONF_DIR}/sympa.conf\" .." + fatal "Cannot set \"$_key\" in file \"${SYMPA_MAIN_CONF_DIR}/sympa.conf\"! \n + See '${_log_file}' for further informations." fi _key=lang @@ -2377,7 +2427,8 @@ else echo_ok else echo_failed - fatal "Cannot set \"$_key\" in file \"${SYMPA_MAIN_CONF_DIR}/sympa.conf\" .." + fatal "Cannot set \"$_key\" in file \"${SYMPA_MAIN_CONF_DIR}/sympa.conf\"! \n + See '${_log_file}' for further informations." fi echo "" >> $_log_file @@ -2385,12 +2436,13 @@ else echo "## -" >> $_log_file echononl "\tAdd \"merge_feature\" to file ${SYMPA_MAIN_CONF_DIR}/sympa.conf .." echo "cat << EOF > ${SYMPA_MAIN_CONF_DIR}/sympa.conf + ## merge_feature ## Customizing messages. If set to 'on', allows the subscribers to send messages with custom users ## 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 + cat << EOF >> ${SYMPA_MAIN_CONF_DIR}/sympa.conf 2>> $_log_file ## merge_feature ## Customizing messages. If set to 'on', allows the subscribers to send messages with custom users @@ -2401,7 +2453,40 @@ EOF echo_ok else echo_failed - error "Cannot set \"merge_feature\" in file \"${SYMPA_MAIN_CONF_DIR}/sympa.conf\" .." + error "Cannot set \"merge_feature\" in file \"${SYMPA_MAIN_CONF_DIR}/sympa.conf\"! \n + See '${_log_file}' for further informations." + fi + + echo "" >> $_log_file + echo "## - Add \"password_hash bcrypt\" to file ${SYMPA_MAIN_CONF_DIR}/sympa.conf .." >> $_log_file + echo "## -" >> $_log_file + echononl "\tAdd \"password_hash bcrypt\" to file ${SYMPA_MAIN_CONF_DIR}/sympa.conf .." + echo "cat << EOF > ${SYMPA_MAIN_CONF_DIR}/sympa.conf + +### password_hash +### +### Information of users are stored in database table user_table. This parameter specifies a +### method to generate password hash. Currently these values are possible: +### md5 Uses MD5 digest algorithm. +### bcrypt Uses bcrypt hash function. +password_hash bcrypt +EOF" >> $_log_file + cat << EOF >> ${SYMPA_MAIN_CONF_DIR}/sympa.conf 2>> $_log_file + +### password_hash +### +### Information of users are stored in database table user_table. This parameter specifies a +### method to generate password hash. Currently these values are possible: +### md5 Uses MD5 digest algorithm. +### bcrypt Uses bcrypt hash function. +password_hash bcrypt +EOF + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Cannot set \"password_hash bcrypt\" in file \"${SYMPA_MAIN_CONF_DIR}/sympa.conf\"! \n + See '${_log_file}' for further informations." fi ## - Set owner/group for \"sympa.conf\".. @@ -2465,7 +2550,7 @@ echo "cat << EOF > /etc/init.d/sympa export PERL5LIB=/usr/share/mhonarc EOF" >> $_log_file -cat << EOF > /etc/init.d/sympa +cat << EOF > /etc/init.d/sympa 2>> $_log_file #!/bin/sh ### BEGIN INIT INFO @@ -2488,7 +2573,7 @@ if [ "$?" != "0" ]; then fi echo "tail -n +2 "$_backup_sympa_initscript" >> /etc/init.d/sympa" >> $_log_file -tail -n +2 "$_backup_sympa_initscript" >> /etc/init.d/sympa +tail -n +2 "$_backup_sympa_initscript" >> /etc/init.d/sympa 2>> $_log_file if [ "$?" != "0" ]; then _failed=true fi @@ -2500,6 +2585,8 @@ if [ "$?" != "0" ]; then fi if $_failed ; then echo_failed + error "Adding Block for run-time dependencies to /etc/init.d/sympa failed! \n + See '${_log_file}' for further informations." else echo_ok fi @@ -2519,7 +2606,8 @@ if ! $UPDATE_SYMPA ; then echo_ok else echo_failed - warn "Removing existing init script links failed." + warn "Removing existing init script links failed! \n + See '${_log_file}' for further informations." fi fi @@ -2537,7 +2625,8 @@ if ! $UPDATE_SYMPA ; then echo_ok else echo_failed - error "Create file /etc/systemd/system/sympa.service failed!" + error "Create file /etc/systemd/system/sympa.service failed! \n + See '${_log_file}' for further informations." fi else echononl "\tMake Sympa mailing list manager at boottime" @@ -2550,7 +2639,8 @@ if ! $UPDATE_SYMPA ; then echo_ok else echo_failed - error "Making sympa start at boottime failed." + error "Making sympa start at boottime failed! \n + See '${_log_file}' for further informations." fi fi # if $SYSTEMD_SUPPORTED fi # if START_AT_BOOTTIME @@ -2610,12 +2700,13 @@ if [ -f /etc/profile ]; then 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 + 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 >> $_log_file 2>&1 if [ "$?" = "0" ]; then echo_ok else echo_failed - warn "Adding $_checkdir to the systems PATH variable failed!" + warn "Adding $_checkdir to the systems PATH variable failed! \n + See '${_log_file}' for further informations." fi else echo_skipped @@ -2963,6 +3054,8 @@ EOF _apache_configtest=true else echo_failed + error "Checking Apache Configuration was not successfully! \n + See '${_log_file}' for further informations." fi echononl "\tGraceful Restart Apache Webserver.." @@ -2977,6 +3070,8 @@ EOF _apache_configtest=true else echo_failed + error "Graceful Restart of Apache Webserver failed! \n + See '${_log_file}' for further informations." fi else echo_skipped @@ -3031,7 +3126,8 @@ else echo_ok else echo_failed - error "Craeting file \"${POSTFIX_CONF_DIR}/$_file_name\" failed!" + error "Craeting file \"${POSTFIX_CONF_DIR}/$_file_name\" failed! \n + See '${_log_file}' for further informations." fi fi @@ -3045,7 +3141,8 @@ else echo_ok else echo_failed - error "\"postmap btree:${POSTFIX_CONF_DIR}/$_file_name\" failed!" + error "\"postmap btree:${POSTFIX_CONF_DIR}/$_file_name\" failed! \n + See '${_log_file}' for further informations." fi echononl "\tConfigure postfix parameter ${_parameter_name}.." @@ -3068,7 +3165,8 @@ else echo_ok else echo_failed - error "Configure postfix main.cf for ${_file_name} failed!" + error "Configure postfix main.cf for ${_file_name} failed! \n + See '${_log_file}' for further informations." fi else cat <> ${POSTFIX_CONF_DIR}/main.cf @@ -3153,7 +3251,8 @@ EOF echo_ok else echo_failed - error "Configure postfix $_parameter_name for $_file_name failed!" + error "Configure postfix $_parameter_name for $_file_name failed! \n + See '${_log_file}' for further informations." fi else if grep -q -e "^relay_domains" ${POSTFIX_CONF_DIR}/main.cf 2>> /dev/null ; then @@ -3165,7 +3264,8 @@ EOF echo_ok else echo_failed - error "Configure postfix $_parameter_name for $_file_name failed!" + error "Configure postfix $_parameter_name for $_file_name failed! \n + See '${_log_file}' for further informations." fi else echo_skipped @@ -3241,7 +3341,8 @@ EOF echo_ok else echo_failed - error "Configure postfix $_parameter_name for $_file_name failed!" + error "Configure postfix $_parameter_name for $_file_name failed! \n + See '${_log_file}' for further informations." fi else echo_skipped @@ -3277,7 +3378,8 @@ EOF echo_ok else echo_failed - error "Configure postfix $_parameter_name for $_file_name failed!" + error "Configure postfix $_parameter_name for $_file_name failed! \n + See '${_log_file}' for further informations." fi else echo_skipped @@ -3309,7 +3411,8 @@ EOF echo_ok else echo_failed - error "Craeting file \"${POSTFIX_CONF_DIR}/$_file_name\" failed!" + error "Craeting file \"${POSTFIX_CONF_DIR}/$_file_name\" failed! \n + See '${_log_file}' for further informations." fi fi @@ -3333,7 +3436,8 @@ EOF echo_ok else echo_failed - error "Configure postfix $_parameter_name for $_file_name failed!" + error "Configure postfix $_parameter_name for $_file_name failed! \n + See '${_log_file}' for further informations." fi else if grep -q -e "^relay_domains" ${POSTFIX_CONF_DIR}/main.cf 2>> /dev/null ; then @@ -3345,7 +3449,8 @@ EOF echo_ok else echo_failed - error "Configure postfix $_parameter_name for $_file_name failed!" + error "Configure postfix $_parameter_name for $_file_name failed! \n + See '${_log_file}' for further informations." fi else echo_skipped @@ -3384,7 +3489,8 @@ EOF echo_ok else echo_failed - error "Craeting file \"${POSTFIX_CONF_DIR}/$_file_name\" failed!" + error "Craeting file \"${POSTFIX_CONF_DIR}/$_file_name\" failed! \n + See '${_log_file}' for further informations." fi fi @@ -3421,7 +3527,8 @@ EOF echo_ok else echo_failed - error "Configure postfix main.cf for ${filename} failed!" + error "Configure postfix main.cf for ${filename} failed! \n + See '${_log_file}' for further informations." fi else cat <> ${POSTFIX_CONF_DIR}/main.cf @@ -3470,7 +3577,8 @@ EOF echo_ok else echo_failed - error "Configure postfix main.cf for ${filename} failed!" + error "Configure postfix main.cf for ${filename} failed! \n + See '${_log_file}' for further informations." fi else cat <> ${POSTFIX_CONF_DIR}/main.cf @@ -3514,7 +3622,8 @@ EOF echo_ok else echo_failed - error "Reloading Postfix SMTP-Server failed!" + error "Reloading Postfix SMTP-Server failed! \n + See '${_log_file}' for further informations." fi else echo "/etc/init.d/postfix reload" >> $_log_file @@ -3523,7 +3632,8 @@ EOF echo_ok else echo_failed - error "Reloading Postfix SMTP-Server failed!" + error "Reloading Postfix SMTP-Server failed! \n + See '${_log_file}' for further informations." fi fi fi @@ -3553,7 +3663,8 @@ if $SYSTEMD_SUPPORTED ; then echo_ok else echo_failed - error "Reloading systemd configuration failed!" + error "Reloading systemd configuration failed! \n + See '${_log_file}' for further informations." fi if $UPDATE_SYMPA ; then @@ -3565,7 +3676,8 @@ if $SYSTEMD_SUPPORTED ; then echo_ok else echo_failed - error "Restarting Sympa mailing list manager failed!" + error "Restarting Sympa mailing list manager failed! \n + See '${_log_file}' for further informations." fi else echononl "\tStarting Sympa mailing list manager .." @@ -3576,7 +3688,8 @@ if $SYSTEMD_SUPPORTED ; then echo_ok else echo_failed - error "Starting Sympa mailing list manager failed!" + error "Starting Sympa mailing list manager failed! \n + See '${_log_file}' for further informations." fi fi @@ -3601,7 +3714,8 @@ else echo_ok else echo_failed - error "Starting Sympa mailing list manager failed!" + error "Starting Sympa mailing list manager failed! \n + See '${_log_file}' for further informations." fi fi fi @@ -3612,7 +3726,7 @@ if $UPDATE_SYMPA ; then echo "" >> $_log_file echo "## - Start Apache Webserver.." >> $_log_file echo "## -" >> $_log_file - if $SYSTEMD_SUPPORTED ; then + if [[ -n "$APACHE_SERVICE_FILE" ]] ; then echo "systemctl start $APACHE_SERVICE_FILE" >> $_log_file systemctl start $APACHE_SERVICE_FILE >> $_log_file 2>&1 if [ "$?" = "0" ]; then @@ -3620,6 +3734,8 @@ if $UPDATE_SYMPA ; then _apache_configtest=true else echo_failed + error "Starting Apache Webserver failed! \n + See '${_log_file}' for further informations." fi else @@ -3629,6 +3745,8 @@ if $UPDATE_SYMPA ; then echo_ok else echo_failed + error "Starting Apache Webserver failed! \n + See '${_log_file}' for further informations." fi fi fi