Skip to content

Commit f91d9a3

Browse files
committed
Improve title mysql / pgsql error
1 parent e8a962b commit f91d9a3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

func/db.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ mysql_connect() {
6161
if [ '0' -ne "$?" ]; then
6262
if [ "$notify" != 'no' ]; then
6363
email=$(grep CONTACT $HESTIA/data/users/admin/user.conf |cut -f 2 -d \')
64+
subj="MySQL connection error on $(hostname)"
6465
echo -e "Can't connect to MySQL $HOST\n$(cat $mysql_out)" |\
6566
$SENDMAIL -s "$subj" $email
6667
fi
@@ -92,6 +93,7 @@ mysql_dump() {
9293
rm -rf $tmpdir
9394
if [ "$notify" != 'no' ]; then
9495
email=$(grep CONTACT $HESTIA/data/users/admin/user.conf |cut -f 2 -d \')
96+
subj="MySQL error on $(hostname)"
9597
echo -e "Can't dump database $database\n$(cat $err)" |\
9698
$SENDMAIL -s "$subj" $email
9799
fi
@@ -118,6 +120,7 @@ psql_connect() {
118120
if [ '0' -ne "$?" ]; then
119121
if [ "$notify" != 'no' ]; then
120122
email=$(grep CONTACT $HESTIA/data/users/admin/user.conf |cut -f 2 -d \')
123+
subj="PostgreSQL connection error on $(hostname)"
121124
echo -e "Can't connect to PostgreSQL $HOST\n$(cat /tmp/e.psql)" |\
122125
$SENDMAIL -s "$subj" $email
123126
fi
@@ -140,6 +143,7 @@ psql_dump() {
140143
rm -rf $tmpdir
141144
if [ "$notify" != 'no' ]; then
142145
email=$(grep CONTACT $HESTIA/data/users/admin/user.conf |cut -f 2 -d \')
146+
subj="PostgreSQL error on $(hostname)"
143147
echo -e "Can't dump database $database\n$(cat /tmp/e.psql)" |\
144148
$SENDMAIL -s "$subj" $email
145149
fi

0 commit comments

Comments
 (0)