diff --git a/manifest.json b/manifest.json index 9726f32..0ac633d 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Monitoring tool for diverse IT components, including networks, servers, VMs and cloud services", "fr": "Outil pour monitorer des réseaux, des serveurs, des VMs et autres services en ligne" }, - "version": "5.0~ynh1", + "version": "5.0.20~ynh1", "url": "https://www.zabbix.com", "upstream": { "license": "GPL-2.0-or-later", diff --git a/scripts/_common.sh b/scripts/_common.sh index eeebdbc..2939639 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -11,7 +11,9 @@ else libsnmpd_version="libsnmp30" fi -pkg_dependencies="libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap liblua5.2-0 fonts-dejavu-core patch smistrip unzip wget fping libcap2-bin libiksemel3 libopenipmi0 libpam-cap libsnmp-base $libsnmpd_version snmptrapd snmpd libjs-prototype jq libssh-4 zabbix-agent zabbix-frontend-php zabbix-server-mysql" +pkg_dependencies="libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap liblua5.2-0 fonts-dejavu-core patch smistrip unzip wget fping libcap2-bin libiksemel3 libopenipmi0 libpam-cap libsnmp-base $libsnmpd_version snmptrapd snmpd libjs-prototype jq libssh-4" + +zabbix_pkg_dependencies="zabbix-agent zabbix-frontend-php zabbix-server-mysql" YNH_PHP_VERSION="7.3" @@ -217,19 +219,6 @@ check_proc_zabbixagent () { fi } -# Install Zabbix repo -# -install_zabbix_repo(){ - ynh_remove_extra_repo --name=zabbix - ynh_install_extra_repo --repo="http://repo.zabbix.com/zabbix/5.0/debian $(lsb_release -sc) main" --key=https://repo.zabbix.com/zabbix-official-repo.key --priority=999 --name=zabbix -} - -# Remove Zabbix repo -# -remove_zabbix_repo(){ - ynh_remove_extra_repo --name=zabbix -} - # Remove previous Zabbix installation # remove_previous_zabbix () { diff --git a/scripts/install b/scripts/install index cf6c218..f356a5c 100644 --- a/scripts/install +++ b/scripts/install @@ -61,8 +61,8 @@ ynh_app_setting_set --app=$app --key=language --value=$language #================================================= ynh_script_progression --message="Installing dependencies..." -install_zabbix_repo ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies +ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="http://repo.zabbix.com/zabbix/5.0/debian $(lsb_release -sc) main" --package="$zabbix_pkg_dependencies" --key="https://repo.zabbix.com/zabbix-official-repo.key" ynh_replace_string --match_string="# $language.UTF-8 UTF-8" --replace_string="$language.UTF-8 UTF-8" --target_file=/etc/locale.gen locale-gen diff --git a/scripts/restore b/scripts/restore index cdcbd0a..378b773 100644 --- a/scripts/restore +++ b/scripts/restore @@ -61,10 +61,9 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= ynh_script_progression --message="Reinstalling dependencies..." -install_zabbix_repo # Define and install dependencies ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies -DEBIAN_FRONTEND=noninteractive apt-mark hold zabbix-server-mysql zabbix-frontend-php +ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="http://repo.zabbix.com/zabbix/5.0/debian $(lsb_release -sc) main" --package="$zabbix_pkg_dependencies" --key="https://repo.zabbix.com/zabbix-official-repo.key" ynh_replace_string --match_string="# $language.UTF-8 UTF-8" --replace_string="$language.UTF-8 UTF-8" --target_file=/etc/locale.gen locale-gen diff --git a/scripts/upgrade b/scripts/upgrade index a7352d8..0824f92 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -89,23 +89,6 @@ fi export mysqlconn="mysql --user=$db_user --password=$db_pwd --database=$db_name" -# patch if zabbix-release installed -if [ "$(dpkg -l zabbix-release 2>/dev/null | wc -l)" -ne 0 ] -then - DEBIAN_FRONTEND=noninteractive apt purge zabbix-release -y - install_zabbix_repo -fi - -# patch if zabbix-release has Candidate version but no Installed version -if [ -f "/etc/apt/sources.list.d/zabbix.list" ] -then - if [ "$(grep -c "4.2" /etc/apt/sources.list.d/zabbix.list)" -eq 1 ] - then - install_zabbix_repo - upgrade_type="UPGRADE_APP" - fi -fi - # patch to remove old zabbix-client service if [ ! -z "$(yunohost service status | grep zabbix-client)" ] then @@ -142,6 +125,8 @@ fi ln -s "/etc/zabbix/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" +ynh_remove_extra_repo --name=zabbix + #================================================= # NGINX CONFIGURATION #================================================= @@ -158,11 +143,8 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading dependencies..." - install_zabbix_repo - DEBIAN_FRONTEND=noninteractive apt-mark unhold zabbix-server-mysql zabbix-frontend-php ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies - - apt-get upgrade -y --option Dpkg::Options::=--force-confdef --option Dpkg::Options::=--force-confold + ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="http://repo.zabbix.com/zabbix/5.0/debian $(lsb_release -sc) main" --package="$zabbix_pkg_dependencies" --key="https://repo.zabbix.com/zabbix-official-repo.key" fi #=================================================