catalyst-auto: convert echo -e
to printf
Makes the code a bit more robust.
This commit is contained in:
parent
5d4de9e446
commit
b86673c791
1 changed files with 4 additions and 2 deletions
|
@ -61,12 +61,14 @@ send_email() {
|
||||||
logfile=$3
|
logfile=$3
|
||||||
|
|
||||||
if [ -n "${logfile}" ]; then
|
if [ -n "${logfile}" ]; then
|
||||||
body=$(echo -e "${message}\n\n"; tail -n 200 "${logfile}"; echo -e "\n\n\nFull build log at ${logfile}")
|
body=$(printf '%b\n\n\n' "${message}"; tail -n 200 "${logfile}"; printf '\n\n\nFull build log at %s\n' "${logfile}")
|
||||||
else
|
else
|
||||||
body=${message}
|
body=${message}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "From: ${EMAIL_FROM}\r\nTo: ${EMAIL_TO}\r\nSubject: ${subject}\r\n\r\n${body}" | /usr/sbin/sendmail -f ${EMAIL_FROM} ${EMAIL_TO//,/ }
|
printf 'From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n%b' \
|
||||||
|
"${EMAIL_FROM}" "${EMAIL_TO}" "${subject}" "${body}" | \
|
||||||
|
/usr/sbin/sendmail -f "${EMAIL_FROM}" ${EMAIL_TO//,/ }
|
||||||
}
|
}
|
||||||
|
|
||||||
run_cmd() {
|
run_cmd() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue