From 0771de2d4b30c4903a2c26df14dd9567e4ee24b7 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Wed, 5 Feb 2020 01:18:44 +0100 Subject: [PATCH] Add optional from email config --- mail.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mail.sh b/mail.sh index fae5ea1..b797447 100755 --- a/mail.sh +++ b/mail.sh @@ -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"