Optimize security updates check script and add customizable from address
This commit is contained in:
parent
da243f92d7
commit
6408d54edb
@ -9,11 +9,12 @@ fi
|
||||
|
||||
echo -e "$UPDATES"
|
||||
|
||||
if [ ! -z "$UPDATES" ]; then
|
||||
HOST=$(hostname)
|
||||
FROM=$(cat ~/.host_mail)
|
||||
DEST=$(cat ~/.admin_mail)
|
||||
|
||||
if [ ! -z "$UPDATES" ]; then
|
||||
echo -e "The following security updates are available for $HOST:\n\n$UPDATES\n\nIt is highly recommended that you perform these updates now" | mailx -s "Security updates are available on $HOST" $DEST
|
||||
echo -e "The following security updates are available for $HOST:\n\n$UPDATES\n\nIt is highly recommended that you perform these updates now" | mailx -s "Security updates are available on $HOST" -r "$FROM" $DEST
|
||||
echo "Mail sent"
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user