server-scripts/mail.sh

10 lines
184 B
Bash
Raw Normal View History

2020-02-02 06:47:47 +01:00
#!/bin/bash
2022-06-05 11:20:56 +02:00
MAILTO=$(cat "/root/.admin_mail")
2020-02-05 01:18:44 +01:00
2022-06-05 11:20:56 +02:00
if [ -f "/root/.host_mail" ]; then
MAILFROM=$(cat "/root/.host_mail")
2020-02-05 01:18:44 +01:00
fi
2020-02-02 06:47:47 +01:00
SUBJECT=$1
2020-02-02 06:49:12 +01:00
cat | mailx -s "$SUBJECT" -r "$MAILFROM" "$MAILTO"