Skip to content

Commit 1693337

Browse files
committed
read mail content from stdin in mail.sh
1 parent 1450655 commit 1693337

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

check.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ for RELEASE in $RELEASES; do
2727

2828
echo 'error'
2929

30-
./mail.sh "${EMAIL}" 'chromium-browser version check error' "${V1}\n->\nhttps://mirrors.edge.kernel.org/linuxmint-packages/pool/upstream/c/chromium/\n\n${V2}\n"
30+
./mail.sh "${EMAIL}" 'chromium-browser version check error' <<< "${V1}\n->\nhttps://mirrors.edge.kernel.org/linuxmint-packages/pool/upstream/c/chromium/\n\n${V2}\n"
3131

3232
elif [ "${V1}" != "${V2}" ]; then
3333

@@ -36,7 +36,7 @@ for RELEASE in $RELEASES; do
3636
mv "${F_VERSION}" "${F_VERSION_OLD}" 2>/dev/null || true
3737
echo "${V2}" > "${F_VERSION}"
3838
touch "${F_VERSION}"
39-
./mail.sh "${EMAIL}" "chromium-browser updated in Mint ($RELEASE)" "${V1}\n->\n${V2}\n"
39+
./mail.sh "${EMAIL}" "chromium-browser updated in Mint ($RELEASE)" <<< "${V1}\n->\n${V2}\n"
4040

4141
echo "${PWD}/copy-packages-run.sh ${RELEASE} ${V1} ${V2}" | at now
4242

copy-packages-run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ MINT=${RELEASE#*/}
1414

1515
output="$((./copy-packages.sh ${RELEASE} ${V1} ${V2} || true) | tee ./copy-packages.sh.${UBUNTU}.log)"
1616
17-
./mail.sh "${EMAIL}" "chromium-browser updated in repository (${RELEASE})" "${V1}\n->\n${V2}\n\n[BEGIN]\n${output}\n[END]\n"
17+
./mail.sh "${EMAIL}" "chromium-browser updated in repository (${RELEASE})" <<< "${V1}\n->\n${V2}\n\n[BEGIN]\n${output}\n[END]\n"
1818
1919
exit 0

mail.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
#!/bin/bash -e
22

3+
#TO="${1}"
4+
#shift
5+
#SUBJECT="${1}"
6+
#shift
7+
#CONTENT="${@}"
8+
39
TO="${1}"
4-
shift
5-
SUBJECT="${1}"
6-
shift
7-
CONTENT="${@}"
10+
SUBJECT="${2}"
11+
CONTENT="$(cat)"
812

913
echo -e "Subject: ${SUBJECT}\n\n${CONTENT}" | /usr/sbin/sendmail "${TO}" || true

0 commit comments

Comments
 (0)