install_update_dovecot.sh: in case of updating, stop dovecot after compiling new sources but before installing new sources.
This commit is contained in:
parent
b4f519d91a
commit
db864eea1a
@ -685,33 +685,14 @@ fi
|
||||
|
||||
|
||||
|
||||
## -----------------
|
||||
## --- Stop dovecot if running
|
||||
|
||||
echononl "\tStop dovecot service.."
|
||||
if ps ax 2> /dev/null | grep -q -E "/usr/local/dovecot[0-9.-]*/sbin/dovecot" > /dev/null 2>&1 ; then
|
||||
if $systemd_support ; then
|
||||
systemctl stop dovecot > /dev/null 2>&1
|
||||
else
|
||||
/etc/init.d/dovecot stop > /dev/null 2>&1
|
||||
fi
|
||||
if [ "$?" = 0 ]; then
|
||||
echo -e "$rc_done"
|
||||
else
|
||||
echo -e "$rc_failed"
|
||||
error "Stopping dovecot service failed"
|
||||
fi
|
||||
else
|
||||
echo -e "$rc_skipped"
|
||||
fi
|
||||
|
||||
|
||||
## -----------------
|
||||
## --- Install Base System
|
||||
|
||||
echo ""
|
||||
echo "Installing Base System.."
|
||||
|
||||
## - Unpack dovecot sources
|
||||
## -
|
||||
cd ${_src_base_dir}
|
||||
echononl "\tUnpack dovecot-${_version}.tar.gz.."
|
||||
tar -xzf dovecot-${_version}.tar.gz > /dev/null
|
||||
@ -724,6 +705,8 @@ fi
|
||||
|
||||
cd dovecot-${_version}
|
||||
|
||||
## - Configure dovecot
|
||||
## -
|
||||
config_params="
|
||||
--prefix=/usr/local/dovecot-${_version} \
|
||||
--with-${db_driver} \
|
||||
@ -752,6 +735,29 @@ else
|
||||
fatal Configuring dovecot failed
|
||||
fi
|
||||
|
||||
|
||||
## -----------------
|
||||
## --- Stop dovecot if running
|
||||
|
||||
echononl "\tStop dovecot service.."
|
||||
if ps ax 2> /dev/null | grep -q -E "/usr/local/dovecot[0-9.-]*/sbin/dovecot" > /dev/null 2>&1 ; then
|
||||
if $systemd_support ; then
|
||||
systemctl stop dovecot > /dev/null 2>&1
|
||||
else
|
||||
/etc/init.d/dovecot stop > /dev/null 2>&1
|
||||
fi
|
||||
if [ "$?" = 0 ]; then
|
||||
echo -e "$rc_done"
|
||||
else
|
||||
echo -e "$rc_failed"
|
||||
error "Stopping dovecot service failed"
|
||||
fi
|
||||
else
|
||||
echo -e "$rc_skipped"
|
||||
fi
|
||||
|
||||
## - Compile dovecot
|
||||
## -
|
||||
echononl "\tCompile Dovecot Sources.."
|
||||
make > ${_log_dir}/dovecot-${_version}-make.log 2>&1 || clean_up 1
|
||||
if [ "$?" = 0 ]; then
|
||||
@ -760,6 +766,9 @@ else
|
||||
echo -e "$rc_failed"
|
||||
fatal Compiling dovecot failed
|
||||
fi
|
||||
|
||||
## - Install dovecot
|
||||
## -
|
||||
echononl "\tInstall Dovecot into Folder /usr/local/dovecot-${_version}"
|
||||
make install > ${_log_dir}/dovecot-${_version}-install.log 2>&1 || clean_up 1
|
||||
if [ "$?" = 0 ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user