From fd7a58121c78bb78ed071b4e11b4a5b55509f399 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Date: Wed, 11 Jul 2018 00:05:27 +0200 Subject: [PATCH] upgrade ynh_send_readme_to_admin helper if mail binary isn't properly selected, it may create an infinite loop at install --- scripts/_common.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 22b21c9..e546a2b 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -569,8 +569,16 @@ Automatic diagnosis data from YunoHost $(yunohost tools diagnosis | grep -B 100 "services:" | sed '/services:/d')" + # Define binary to use for mail command + if [ -e /usr/bin/bsd-mailx ] + then + local mail_bin=/usr/bin/bsd-mailx + else + local mail_bin=/usr/bin/mail.mailutils + fi + # Send the email to the recipients - echo "$mail_message" | mail -a "Content-Type: text/plain; charset=UTF-8" -s "$mail_subject" "$recipients" + echo "$mail_message" | $mail_bin -a "Content-Type: text/plain; charset=UTF-8" -s "$mail_subject" "$recipients" } #=================================================