Add optional from email config

This commit is contained in:
Alice Gaudon 2020-02-05 01:18:44 +01:00
parent 05ec42e03b
commit 0771de2d4b
1 changed files with 5 additions and 0 deletions

View File

@ -1,4 +1,9 @@
#!/bin/bash
MAILTO=$(cat "$HOME/.admin_mail")
if [ -f "$HOME/.host_mail" ]; then
MAILFROM=$(cat "$HOME/.host_mail")
fi
SUBJECT=$1
cat | mailx -s "$SUBJECT" -r "$MAILFROM" "$MAILTO"