From de68a6bc8f7a1cc69eecd7cd929e884505280c68 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Tue, 8 Oct 2013 00:27:38 +0300 Subject: [PATCH] send email using php wrapper --- bin/v-backup-user | 6 +----- bin/v-restart-cron | 6 +----- bin/v-restart-dns | 6 +----- bin/v-restart-ftp | 6 +----- bin/v-restart-mail | 6 +----- bin/v-restart-proxy | 6 +----- bin/v-restart-service | 6 +----- bin/v-restart-web | 6 +----- bin/v-restore-user | 7 +------ 9 files changed, 9 insertions(+), 46 deletions(-) diff --git a/bin/v-backup-user b/bin/v-backup-user index 37a6edd2..edd20e91 100755 --- a/bin/v-backup-user +++ b/bin/v-backup-user @@ -53,11 +53,7 @@ else subj="$user → backup failed" email=$(grep CONTACT $VESTA/data/users/admin/user.conf | cut -f 2 -d \') fi -if [ -e "$VESTA/web/inc/mail-wrapper.php" ]; then - send_mail="$VESTA/web/inc/mail-wrapper.php" -else - send_mail=$(which mail) -fi +send_mail="$VESTA/web/inc/mail-wrapper.php" # Check load average la=$(cat /proc/loadavg | cut -f 1 -d ' ' | cut -f 1 -d '.') diff --git a/bin/v-restart-cron b/bin/v-restart-cron index 87223111..8bb317b4 100755 --- a/bin/v-restart-cron +++ b/bin/v-restart-cron @@ -34,11 +34,7 @@ if [ ! -z "$CRON_SYSTEM" ]; then if [ $? -ne 0 ]; then /etc/init.d/$CRON_SYSTEM restart >/dev/null 2>&1 if [ $? -ne 0 ]; then - if [ -e "$VESTA/web/inc/mail-wrapper.php" ]; then - send_mail="$VESTA/web/inc/mail-wrapper.php" - else - send_mail=$(which mail) - fi + send_mail="$VESTA/web/inc/mail-wrapper.php" email=$(grep CONTACT $VESTA/data/users/admin/user.conf) email=$(echo "$email" | cut -f 2 -d "'") tmpfile=$(mktemp) diff --git a/bin/v-restart-dns b/bin/v-restart-dns index 87a0bf11..12778e14 100755 --- a/bin/v-restart-dns +++ b/bin/v-restart-dns @@ -34,11 +34,7 @@ if [ ! -z "$DNS_SYSTEM" ]; then if [ $? -ne 0 ]; then /etc/init.d/$DNS_SYSTEM restart >/dev/null 2>&1 if [ $? -ne 0 ]; then - if [ -e "$VESTA/web/inc/mail-wrapper.php" ]; then - send_mail="$VESTA/web/inc/mail-wrapper.php" - else - send_mail=$(which mail) - fi + send_mail="$VESTA/web/inc/mail-wrapper.php" email=$(grep CONTACT $VESTA/data/users/admin/user.conf) email=$(echo "$email" | cut -f 2 -d "'") tmpfile=$(mktemp) diff --git a/bin/v-restart-ftp b/bin/v-restart-ftp index da106347..0f0bc6d5 100755 --- a/bin/v-restart-ftp +++ b/bin/v-restart-ftp @@ -34,11 +34,7 @@ if [ ! -z "$FTP_SYSTEM" ]; then if [ $? -ne 0 ]; then /etc/init.d/$FTP_SYSTEM restart >/dev/null 2>&1 if [ $? -ne 0 ]; then - if [ -e "$VESTA/web/inc/mail-wrapper.php" ]; then - send_mail="$VESTA/web/inc/mail-wrapper.php" - else - send_mail=$(which mail) - fi + send_mail="$VESTA/web/inc/mail-wrapper.php" email=$(grep CONTACT $VESTA/data/users/admin/user.conf) email=$(echo "$email" | cut -f 2 -d "'") tmpfile=$(mktemp) diff --git a/bin/v-restart-mail b/bin/v-restart-mail index 4afcd469..b7bba97c 100755 --- a/bin/v-restart-mail +++ b/bin/v-restart-mail @@ -34,11 +34,7 @@ if [ ! -z "$MAIL_SYSTEM" ]; then if [ $? -ne 0 ]; then /etc/init.d/$MAIL_SYSTEM restart >/dev/null 2>&1 if [ $? -ne 0 ]; then - if [ -e "$VESTA/web/inc/mail-wrapper.php" ]; then - send_mail="$VESTA/web/inc/mail-wrapper.php" - else - send_mail=$(which mail) - fi + send_mail="$VESTA/web/inc/mail-wrapper.php" email=$(grep CONTACT $VESTA/data/users/admin/user.conf) email=$(echo "$email" | cut -f 2 -d "'") tmpfile=$(mktemp) diff --git a/bin/v-restart-proxy b/bin/v-restart-proxy index 67e12cf7..ad269e3c 100755 --- a/bin/v-restart-proxy +++ b/bin/v-restart-proxy @@ -34,11 +34,7 @@ if [ ! -z "$PROXY_SYSTEM" ]; then if [ $? -ne 0 ]; then /etc/init.d/$PROXY_SYSTEM restart >/dev/null 2>&1 if [ $? -ne 0 ]; then - if [ -e "$VESTA/web/inc/mail-wrapper.php" ]; then - send_mail="$VESTA/web/inc/mail-wrapper.php" - else - send_mail=$(which mail) - fi + send_mail="$VESTA/web/inc/mail-wrapper.php" email=$(grep CONTACT $VESTA/data/users/admin/user.conf) email=$(echo "$email" | cut -f 2 -d "'") tmpfile=$(mktemp) diff --git a/bin/v-restart-service b/bin/v-restart-service index dfffab6b..b15cfaa2 100755 --- a/bin/v-restart-service +++ b/bin/v-restart-service @@ -30,11 +30,7 @@ check_args '1' "$#" 'SERVICE' if [ -x "/etc/init.d/$service" ]; then /etc/init.d/$service restart >/dev/null 2>&1 if [ $? -ne 0 ]; then - if [ -e "$VESTA/web/inc/mail-wrapper.php" ]; then - send_mail="$VESTA/web/inc/mail-wrapper.php" - else - send_mail=$(which mail) - fi + send_mail="$VESTA/web/inc/mail-wrapper.php" email=$(grep CONTACT $VESTA/data/users/admin/user.conf) email=$(echo "$email" | cut -f 2 -d "'") tmpfile=$(mktemp) diff --git a/bin/v-restart-web b/bin/v-restart-web index 28bb73e0..27e734f9 100755 --- a/bin/v-restart-web +++ b/bin/v-restart-web @@ -34,11 +34,7 @@ if [ ! -z "$WEB_SYSTEM" ]; then if [ "$?" -ne 0 ]; then /etc/init.d/$WEB_SYSTEM restart >/dev/null 2>&1 if [ $? -ne 0 ]; then - if [ -e "$VESTA/web/inc/mail-wrapper.php" ]; then - send_mail="$VESTA/web/inc/mail-wrapper.php" - else - send_mail=$(which mail) - fi + send_mail="$VESTA/web/inc/mail-wrapper.php" email=$(grep CONTACT $VESTA/data/users/admin/user.conf) email=$(echo "$email" | cut -f 2 -d "'") tmpfile=$(mktemp) diff --git a/bin/v-restore-user b/bin/v-restore-user index acf93489..c6e3ec9f 100755 --- a/bin/v-restore-user +++ b/bin/v-restore-user @@ -62,12 +62,7 @@ is_backup_available #----------------------------------------------------------# # Define email wrapper -if [ -e "$VESTA/web/inc/mail-wrapper.php" ]; then - send_mail="$VESTA/web/inc/mail-wrapper.php" -else - send_mail=$(which mail) -fi - +send_mail="$VESTA/web/inc/mail-wrapper.php" # Check user check_user=$(is_object_valid 'user' 'USER' "$user")