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:
parent
08ac03c50a
commit
15f5787f3b
1 changed files with 34 additions and 18 deletions
|
@ -71,11 +71,24 @@ path_url=$(ynh_normalize_url_path $path_url)
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD UPGRADE STEPS
|
# 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 -rp /etc/zabbix /tmp/
|
||||||
cp -p /usr/share/zabbix/conf/zabbix.conf.php /tmp/
|
cp -p /usr/share/zabbix/conf/zabbix.conf.php /tmp/
|
||||||
|
|
||||||
DEBIAN_FRONTEND=noninteractive apt-mark unhold zabbix-server-mysql zabbix-frontend-php
|
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
|
DEBIAN_FRONTEND=noninteractive apt-get -y download zabbix-frontend-php
|
||||||
ar x *.deb
|
ar x *.deb
|
||||||
tar xzf control.tar.gz
|
tar xzf control.tar.gz
|
||||||
|
@ -94,3 +107,6 @@ cp -pf /tmp/zabbix.conf.php /usr/share/zabbix/conf/
|
||||||
rm -fr /tmp/zabbix*
|
rm -fr /tmp/zabbix*
|
||||||
|
|
||||||
systemctl reload nginx
|
systemctl reload nginx
|
||||||
|
else
|
||||||
|
ynh_print_info "Nothing to update !"
|
||||||
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue