mirror of
https://github.com/myvesta/vesta
synced 2025-07-05 20:41:53 -07:00
send_email_to_admin function
This commit is contained in:
parent
dd9c8cf1f6
commit
d03d8e9537
1 changed files with 16 additions and 0 deletions
16
func/main.sh
16
func/main.sh
|
@ -1098,3 +1098,19 @@ no_symlink_chmod() {
|
|||
chmod "${filemode}" "${i}"
|
||||
done
|
||||
}
|
||||
|
||||
# $1 = subject
|
||||
# $2 = body
|
||||
send_email_to_admin() {
|
||||
email=$(grep CONTACT /usr/local/vesta/data/users/admin/user.conf)
|
||||
email=$(echo "$email" | cut -f 2 -d "'")
|
||||
if [ -z "$email" ]; then
|
||||
if [ ! -z "$NOTIFY_ADMIN_FULL_BACKUP" ]; then
|
||||
email=$NOTIFY_ADMIN_FULL_BACKUP
|
||||
fi
|
||||
fi
|
||||
if [ -z "$email" ]; then
|
||||
return;
|
||||
fi
|
||||
echo "$2" | $SENDMAIL -s "$1" "$email" 'yes'
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue