mirror of
https://github.com/myvesta/vesta
synced 2025-07-10 07:13:17 -07:00
send email using php wrapper
This commit is contained in:
parent
8f03ce5e43
commit
de68a6bc8f
9 changed files with 9 additions and 46 deletions
|
@ -53,11 +53,7 @@ else
|
||||||
subj="$user → backup failed"
|
subj="$user → backup failed"
|
||||||
email=$(grep CONTACT $VESTA/data/users/admin/user.conf | cut -f 2 -d \')
|
email=$(grep CONTACT $VESTA/data/users/admin/user.conf | cut -f 2 -d \')
|
||||||
fi
|
fi
|
||||||
if [ -e "$VESTA/web/inc/mail-wrapper.php" ]; then
|
send_mail="$VESTA/web/inc/mail-wrapper.php"
|
||||||
send_mail="$VESTA/web/inc/mail-wrapper.php"
|
|
||||||
else
|
|
||||||
send_mail=$(which mail)
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check load average
|
# Check load average
|
||||||
la=$(cat /proc/loadavg | cut -f 1 -d ' ' | cut -f 1 -d '.')
|
la=$(cat /proc/loadavg | cut -f 1 -d ' ' | cut -f 1 -d '.')
|
||||||
|
|
|
@ -34,11 +34,7 @@ if [ ! -z "$CRON_SYSTEM" ]; then
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
/etc/init.d/$CRON_SYSTEM restart >/dev/null 2>&1
|
/etc/init.d/$CRON_SYSTEM restart >/dev/null 2>&1
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
if [ -e "$VESTA/web/inc/mail-wrapper.php" ]; then
|
send_mail="$VESTA/web/inc/mail-wrapper.php"
|
||||||
send_mail="$VESTA/web/inc/mail-wrapper.php"
|
|
||||||
else
|
|
||||||
send_mail=$(which mail)
|
|
||||||
fi
|
|
||||||
email=$(grep CONTACT $VESTA/data/users/admin/user.conf)
|
email=$(grep CONTACT $VESTA/data/users/admin/user.conf)
|
||||||
email=$(echo "$email" | cut -f 2 -d "'")
|
email=$(echo "$email" | cut -f 2 -d "'")
|
||||||
tmpfile=$(mktemp)
|
tmpfile=$(mktemp)
|
||||||
|
|
|
@ -34,11 +34,7 @@ if [ ! -z "$DNS_SYSTEM" ]; then
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
/etc/init.d/$DNS_SYSTEM restart >/dev/null 2>&1
|
/etc/init.d/$DNS_SYSTEM restart >/dev/null 2>&1
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
if [ -e "$VESTA/web/inc/mail-wrapper.php" ]; then
|
send_mail="$VESTA/web/inc/mail-wrapper.php"
|
||||||
send_mail="$VESTA/web/inc/mail-wrapper.php"
|
|
||||||
else
|
|
||||||
send_mail=$(which mail)
|
|
||||||
fi
|
|
||||||
email=$(grep CONTACT $VESTA/data/users/admin/user.conf)
|
email=$(grep CONTACT $VESTA/data/users/admin/user.conf)
|
||||||
email=$(echo "$email" | cut -f 2 -d "'")
|
email=$(echo "$email" | cut -f 2 -d "'")
|
||||||
tmpfile=$(mktemp)
|
tmpfile=$(mktemp)
|
||||||
|
|
|
@ -34,11 +34,7 @@ if [ ! -z "$FTP_SYSTEM" ]; then
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
/etc/init.d/$FTP_SYSTEM restart >/dev/null 2>&1
|
/etc/init.d/$FTP_SYSTEM restart >/dev/null 2>&1
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
if [ -e "$VESTA/web/inc/mail-wrapper.php" ]; then
|
send_mail="$VESTA/web/inc/mail-wrapper.php"
|
||||||
send_mail="$VESTA/web/inc/mail-wrapper.php"
|
|
||||||
else
|
|
||||||
send_mail=$(which mail)
|
|
||||||
fi
|
|
||||||
email=$(grep CONTACT $VESTA/data/users/admin/user.conf)
|
email=$(grep CONTACT $VESTA/data/users/admin/user.conf)
|
||||||
email=$(echo "$email" | cut -f 2 -d "'")
|
email=$(echo "$email" | cut -f 2 -d "'")
|
||||||
tmpfile=$(mktemp)
|
tmpfile=$(mktemp)
|
||||||
|
|
|
@ -34,11 +34,7 @@ if [ ! -z "$MAIL_SYSTEM" ]; then
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
/etc/init.d/$MAIL_SYSTEM restart >/dev/null 2>&1
|
/etc/init.d/$MAIL_SYSTEM restart >/dev/null 2>&1
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
if [ -e "$VESTA/web/inc/mail-wrapper.php" ]; then
|
send_mail="$VESTA/web/inc/mail-wrapper.php"
|
||||||
send_mail="$VESTA/web/inc/mail-wrapper.php"
|
|
||||||
else
|
|
||||||
send_mail=$(which mail)
|
|
||||||
fi
|
|
||||||
email=$(grep CONTACT $VESTA/data/users/admin/user.conf)
|
email=$(grep CONTACT $VESTA/data/users/admin/user.conf)
|
||||||
email=$(echo "$email" | cut -f 2 -d "'")
|
email=$(echo "$email" | cut -f 2 -d "'")
|
||||||
tmpfile=$(mktemp)
|
tmpfile=$(mktemp)
|
||||||
|
|
|
@ -34,11 +34,7 @@ if [ ! -z "$PROXY_SYSTEM" ]; then
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
/etc/init.d/$PROXY_SYSTEM restart >/dev/null 2>&1
|
/etc/init.d/$PROXY_SYSTEM restart >/dev/null 2>&1
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
if [ -e "$VESTA/web/inc/mail-wrapper.php" ]; then
|
send_mail="$VESTA/web/inc/mail-wrapper.php"
|
||||||
send_mail="$VESTA/web/inc/mail-wrapper.php"
|
|
||||||
else
|
|
||||||
send_mail=$(which mail)
|
|
||||||
fi
|
|
||||||
email=$(grep CONTACT $VESTA/data/users/admin/user.conf)
|
email=$(grep CONTACT $VESTA/data/users/admin/user.conf)
|
||||||
email=$(echo "$email" | cut -f 2 -d "'")
|
email=$(echo "$email" | cut -f 2 -d "'")
|
||||||
tmpfile=$(mktemp)
|
tmpfile=$(mktemp)
|
||||||
|
|
|
@ -30,11 +30,7 @@ check_args '1' "$#" 'SERVICE'
|
||||||
if [ -x "/etc/init.d/$service" ]; then
|
if [ -x "/etc/init.d/$service" ]; then
|
||||||
/etc/init.d/$service restart >/dev/null 2>&1
|
/etc/init.d/$service restart >/dev/null 2>&1
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
if [ -e "$VESTA/web/inc/mail-wrapper.php" ]; then
|
send_mail="$VESTA/web/inc/mail-wrapper.php"
|
||||||
send_mail="$VESTA/web/inc/mail-wrapper.php"
|
|
||||||
else
|
|
||||||
send_mail=$(which mail)
|
|
||||||
fi
|
|
||||||
email=$(grep CONTACT $VESTA/data/users/admin/user.conf)
|
email=$(grep CONTACT $VESTA/data/users/admin/user.conf)
|
||||||
email=$(echo "$email" | cut -f 2 -d "'")
|
email=$(echo "$email" | cut -f 2 -d "'")
|
||||||
tmpfile=$(mktemp)
|
tmpfile=$(mktemp)
|
||||||
|
|
|
@ -34,11 +34,7 @@ if [ ! -z "$WEB_SYSTEM" ]; then
|
||||||
if [ "$?" -ne 0 ]; then
|
if [ "$?" -ne 0 ]; then
|
||||||
/etc/init.d/$WEB_SYSTEM restart >/dev/null 2>&1
|
/etc/init.d/$WEB_SYSTEM restart >/dev/null 2>&1
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
if [ -e "$VESTA/web/inc/mail-wrapper.php" ]; then
|
send_mail="$VESTA/web/inc/mail-wrapper.php"
|
||||||
send_mail="$VESTA/web/inc/mail-wrapper.php"
|
|
||||||
else
|
|
||||||
send_mail=$(which mail)
|
|
||||||
fi
|
|
||||||
email=$(grep CONTACT $VESTA/data/users/admin/user.conf)
|
email=$(grep CONTACT $VESTA/data/users/admin/user.conf)
|
||||||
email=$(echo "$email" | cut -f 2 -d "'")
|
email=$(echo "$email" | cut -f 2 -d "'")
|
||||||
tmpfile=$(mktemp)
|
tmpfile=$(mktemp)
|
||||||
|
|
|
@ -62,12 +62,7 @@ is_backup_available
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
|
|
||||||
# Define email wrapper
|
# Define email wrapper
|
||||||
if [ -e "$VESTA/web/inc/mail-wrapper.php" ]; then
|
send_mail="$VESTA/web/inc/mail-wrapper.php"
|
||||||
send_mail="$VESTA/web/inc/mail-wrapper.php"
|
|
||||||
else
|
|
||||||
send_mail=$(which mail)
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# Check user
|
# Check user
|
||||||
check_user=$(is_object_valid 'user' 'USER' "$user")
|
check_user=$(is_object_valid 'user' 'USER' "$user")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue