The mail recipient can be modified on the fly

This commit is contained in:
Jérémy Lecour 2019-03-09 21:59:17 +01:00
parent c2b44f0e48
commit 1bfe7c4b86

View file

@ -421,10 +421,9 @@ if [ "${INTERACTIVE}" = "1" ]; then
else
y="y"; n="N"
fi
question="Do you want to send an email? [${y}${n}] "
answer=""
while true; do
echo "${question}"
echo "Do you want to send an email to <${EVOMAINTMAIL}>? [${y}${n}e] "
read -r answer
case $answer in
[Yy] )
@ -434,6 +433,14 @@ if [ "${INTERACTIVE}" = "1" ]; then
[Nn] )
break
;;
[Ee] )
echo "To: [${EVOMAINTMAIL}] "
read -r mail_recipient
if [ -n "${mail_recipient}" ]; then
EVOMAINTMAIL="${mail_recipient}"
echo "changed to ${EVOMAINTMAIL}"
fi
;;
"" )
if [ "${OPT_MAIL}" = "1" ]; then
hook_mail