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

launch update only if needed

This commit is contained in:
Mickael-Martin 2018-12-12 18:42:52 +01:00
parent 08ac03c50a
commit 15f5787f3b

View file

@ -71,11 +71,24 @@ path_url=$(ynh_normalize_url_path $path_url)
#=================================================
# STANDARD UPGRADE STEPS
#=================================================
ynh_package_update
zabbix-server-mysql-installedversion=$(apt-cache policy zabbix-server-mysql | grep -Po "Installed: \K(.*)")
zabbix-server-mysql-candidateversion=$(apt-cache policy zabbix-server-mysql | grep -Po "Candidate: \K(.*)")
zabbix-frontend-php-installedversion=$(apt-cache policy zabbix-frontend-php | grep -Po "Installed: \K(.*)")
zabbix-frontend-php-candidateversion=$(apt-cache policy zabbix-frontend-php | grep -Po "Candidate: \K(.*)")
zabbix-agent-installedversion=$(apt-cache policy zabbix-agent | grep -Po "Installed: \K(.*)")
zabbix-agent-candidateversion=$(apt-cache policy zabbix-zabbix-agent | grep -Po "Candidate: \K(.*)")
if [ "$zabbix-server-mysql-installedversion" == "zabbix-server-mysql-installedversion" -a "$zabbix-frontend-php-installedversion" == "zabbix-frontend-php-installedversion" -a "$zabbix-agent-installedversion" == "zabbix-agent-installedversion" ]
then
cp -rp /etc/zabbix /tmp/
cp -p /usr/share/zabbix/conf/zabbix.conf.php /tmp/
DEBIAN_FRONTEND=noninteractive apt-mark unhold zabbix-server-mysql zabbix-frontend-php
ynh_package_update
DEBIAN_FRONTEND=noninteractive apt-get -y download zabbix-frontend-php
ar x *.deb
tar xzf control.tar.gz
@ -94,3 +107,6 @@ cp -pf /tmp/zabbix.conf.php /usr/share/zabbix/conf/
rm -fr /tmp/zabbix*
systemctl reload nginx
else
ynh_print_info "Nothing to update !"
fi