[go: up one dir, main page]

File: 10mail

package info (click to toggle)
smartmontools 7.4-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 4,980 kB
  • sloc: cpp: 52,616; ansic: 9,924; sh: 6,067; makefile: 967
file content (12 lines) | stat: -rwxr-xr-x 412 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/sh -e

# check whether /usr/bin/mail exists and is executable
if ! [ -x /usr/bin/mail ]; then
	printf 'Your system does not have /usr/bin/mail. Install the bsd-mailx or mailutils package.\n' >&2
	exit 1
fi

# send mail to each given address (separately for privacy reasons)
for address in ${SMARTD_ADDRESS}; do
	printf '%s' "${SMARTD_FULLMESSAGE}" | /usr/bin/mail -s "${SMARTD_SUBJECT}" "${address}"
done