Fix emailadres and subject

This commit is contained in:
ikheetjeff 2024-05-05 20:28:31 +02:00 committed by GitHub
parent 66ae5580cd
commit 4acfa26de5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -610,6 +610,9 @@ rebuild_pgsql_database() {
if [ -z $HOST ] || [ -z $USER ] || [ -z $PASSWORD ] || [ -z $TPL ]; then
echo "Error: postgresql config parsing failed"
if [ ! -z "$SENDMAIL" ]; then
subj="Error: postgresql config parsing failed"
email=$($BIN/v-get-user-value admin CONTACT)
echo "Can't parse PostgreSQL config" | $SENDMAIL -s "$subj" $email
fi
log_event "$E_PARSING" "$ARGUMENTS"
@ -621,6 +624,9 @@ rebuild_pgsql_database() {
if [ '0' -ne "$?" ]; then
echo "Error: Connection failed"
if [ ! -z "$SENDMAIL" ]; then
subj="Error: Connection failed"
email=$($BIN/v-get-user-value admin CONTACT)
echo "Database connection to PostgreSQL host $HOST failed" |\
$SENDMAIL -s "$subj" $email
fi