Direct download does not work. So stop installation with option to proceed.

This commit is contained in:
Christoph 2019-10-11 02:00:09 +02:00
parent 7d0c63b842
commit 98b68a68b0

View File

@ -506,12 +506,23 @@ echo "Download sources.."
## - ## -
echononl "\tDownload dovecot-${_version}.tar.gz" echononl "\tDownload dovecot-${_version}.tar.gz"
if [ ! -f "${_src_base_dir}/dovecot-${_version}.tar.gz" ]; then if [ ! -f "${_src_base_dir}/dovecot-${_version}.tar.gz" ]; then
wget http://www.dovecot.org/releases/${dovecot_main_version}/dovecot-${_version}.tar.gz > /dev/null 2>&1 wget --no-check-certificate https://dovecot.org/releases/${dovecot_main_version}/dovecot-${_version}.tar.gz > /dev/null 2>&1
if [ "$?" = 0 ]; then if [ "$?" = 0 ]; then
echo -e "$rc_done" echo -e "$rc_done"
else else
echo -e "$rc_failed" echo -e "$rc_failed"
fatal "Download failed" error "Direct download of 'dovecot-${_version}.tar.gz' failed
Download \033[1mdovecot-${_version}.tar.gz\033[m manually and proceed instllation."
echononl "Proceed instllation [yes/no]: "
read OK
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
echononl "Wrong entry! - repeat [yes/nno]: "
read OK
done
[[ $OK = "yes" ]] || fatal "Abbruch durch User"
fi fi
else else
echo -e "$rc_skipped" echo -e "$rc_skipped"
@ -522,12 +533,25 @@ fi
## - ## -
echononl "\tDownload dovecot-${dovecot_main_version}-pigeonhole-${_pigeonhole}.tar.gz.." echononl "\tDownload dovecot-${dovecot_main_version}-pigeonhole-${_pigeonhole}.tar.gz.."
if [ ! -f "${_src_base_dir}/dovecot-${dovecot_main_version}-pigeonhole-${_pigeonhole}.tar.gz" ]; then if [ ! -f "${_src_base_dir}/dovecot-${dovecot_main_version}-pigeonhole-${_pigeonhole}.tar.gz" ]; then
wget http://pigeonhole.dovecot.org/releases/${dovecot_main_version}/dovecot-${dovecot_main_version}-pigeonhole-${_pigeonhole}.tar.gz > /dev/null 2>&1 wget --no-check-certificate https://pigeonhole.dovecot.org/releases/${dovecot_main_version}/dovecot-${dovecot_main_version}-pigeonhole-${_pigeonhole}.tar.gz > /dev/null 2>&1
if [ "$?" = 0 ]; then if [ "$?" = 0 ]; then
echo -e "$rc_done" echo -e "$rc_done"
else else
echo -e "$rc_failed" echo -e "$rc_failed"
fatal "Download failed" error "Direct download of 'dovecot-${dovecot_main_version}-pigeonhole-${_pigeonhole}.tar.gz' failed
Download \033[1mdovecot-${dovecot_main_version}-pigeonhole-${_pigeonhole}.tar.gz\033[m manually
and proceed instllation."
echononl "\tProceed instllation [yes/no]: "
read OK
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
echononl "Wrong entry! - repeat [yes/nno]: "
read OK
done
[[ $OK = "yes" ]] || fatal "Abbruch durch User"
fi fi
else else
echo -e "$rc_skipped" echo -e "$rc_skipped"
@ -564,15 +588,16 @@ if $_new ; then
else else
echo -e "$rc_skipped" echo -e "$rc_skipped"
fi fi
fi
## ----------------- ## -----------------
## - Create Users/groups needed for dovecot ## - Create Users/groups needed for dovecot
echo "" echo ""
echo "Create required users/groups.." echo "Create required users/groups.."
echononl "\tCreate group dovecot.." echononl "\tCreate group dovecot.."
if ! grep dovecot /etc/group > /dev/null ; then if ! grep dovecot /etc/group > /dev/null ; then
addgroup --system --gid 91 dovecot > ${_log_dir}/system.log 2>&1 addgroup --system --gid 91 dovecot > ${_log_dir}/system.log 2>&1
if [ "$?" = 0 ]; then if [ "$?" = 0 ]; then
echo -e "$rc_done" echo -e "$rc_done"
@ -580,12 +605,12 @@ if $_new ; then
echo -e "$rc_failed" echo -e "$rc_failed"
fatal Create group failed fatal Create group failed
fi fi
else else
echo -e "$rc_skipped" echo -e "$rc_skipped"
fi fi
echononl "\tCreate user dovecot.." echononl "\tCreate user dovecot.."
if ! grep dovecot /etc/passwd > /dev/null ; then if ! grep dovecot /etc/passwd > /dev/null ; then
adduser --system --home /var/empty --no-create-home --shell /usr/sbin/nologin \ adduser --system --home /var/empty --no-create-home --shell /usr/sbin/nologin \
--ingroup dovecot --uid 91 dovecot > ${_log_dir}/system.log 2>&1 --ingroup dovecot --uid 91 dovecot > ${_log_dir}/system.log 2>&1
if [ "$?" = 0 ]; then if [ "$?" = 0 ]; then
@ -594,13 +619,13 @@ if $_new ; then
echo -e "$rc_failed" echo -e "$rc_failed"
fatal Create user failed fatal Create user failed
fi fi
else else
echo -e "$rc_skipped" echo -e "$rc_skipped"
fi fi
echononl "\tCreate group dovenull.." echononl "\tCreate group dovenull.."
if ! grep dovenull /etc/group > /dev/null ; then if ! grep dovenull /etc/group > /dev/null ; then
addgroup --system --gid 65533 dovenull > ${_log_dir}/system.log 2>&1 addgroup --system --gid 65533 dovenull > ${_log_dir}/system.log 2>&1
if [ "$?" = 0 ]; then if [ "$?" = 0 ]; then
echo -e "$rc_done" echo -e "$rc_done"
@ -608,11 +633,11 @@ if $_new ; then
echo -e "$rc_failed" echo -e "$rc_failed"
fatal Create group failed fatal Create group failed
fi fi
else else
echo -e "$rc_skipped" echo -e "$rc_skipped"
fi fi
echononl "\tCreate user dovenull.." echononl "\tCreate user dovenull.."
if ! grep dovenull /etc/passwd > /dev/null ; then if ! grep dovenull /etc/passwd > /dev/null ; then
adduser --system --home /var/empty --no-create-home --shell /usr/sbin/nologin \ adduser --system --home /var/empty --no-create-home --shell /usr/sbin/nologin \
--ingroup dovenull --uid 65533 dovenull > ${_log_dir}/system.log 2>&1 --ingroup dovenull --uid 65533 dovenull > ${_log_dir}/system.log 2>&1
if [ "$?" = 0 ]; then if [ "$?" = 0 ]; then
@ -621,10 +646,8 @@ if $_new ; then
echo -e "$rc_failed" echo -e "$rc_failed"
fatal Create user failed fatal Create user failed
fi fi
else else
echo -e "$rc_skipped" echo -e "$rc_skipped"
fi
fi fi
if $update ; then if $update ; then