1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/zabbix_ynh.git synced 2024-09-03 20:36:14 +02:00

Add media type email

This commit is contained in:
Mickael-Martin 2020-04-30 12:38:43 +02:00
parent 6427793c61
commit 7c45e8b214
4 changed files with 19 additions and 2 deletions

View file

@ -6,7 +6,7 @@
"en": "A monitoring tool for diverse IT components, including networks, servers, VMs and cloud services.",
"fr": "Un outil pour monitorer des réseaux, des serveurs, des VMs et autres services en ligne"
},
"version": "3.2",
"version": "3.2.2",
"url": "https://www.zabbix.com",
"license": "free",
"maintainer": {

View file

@ -207,4 +207,14 @@ convert_ZabbixDB(){
do
mysql --user=$db_user --password=$db_pwd --database=$db_name -e "ALTER TABLE $t CONVERT TO character set utf8 collate utf8_bin;"
done
}
}
#if not already modified, add email media type with the yunohost server mail.
set_mediatype_default_yunohost(){
set -x
if [ $($mysqlconn -BN -e "SELECT count(*) FROM media_type WHERE smtp_server LIKE 'mail.example.com' AND status=1;") -eq 1 ] ; then
$mysqlconn -BN -e "UPDATE media_type SET smtp_server = 'localhost', smtp_helo = '"$domain"', smtp_email = 'zabbix@"$domain"', smtp_port = '587', status=0 , smtp_security=1 WHERE smtp_server LIKE 'mail.example.com' AND status=1;"
ynh_print_info "Default Media type added !"
fi
set +x
}

View file

@ -172,6 +172,8 @@ done
disable_guest_user
set_mediatype_default_yunohost
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================

View file

@ -188,6 +188,11 @@ update_initZabbixConf
#=================================================
convert_ZabbixDB
#=================================================
# Add settings for yunohost mail server
#=================================================
set_mediatype_default_yunohost
#=================================================
# Update php-fpm confi
#=================================================