|
|
@@ -48,19 +48,6 @@ if [ -z $final_path ]; then
|
|
|
ynh_app_setting_set $app final_path $final_path
|
|
|
fi
|
|
|
|
|
|
-#=================================================
|
|
|
-# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
|
|
-#=================================================
|
|
|
-
|
|
|
-# Backup the current version of the app
|
|
|
-ynh_backup_before_upgrade
|
|
|
-ynh_clean_setup () {
|
|
|
- # restore it if the upgrade fails
|
|
|
- ynh_restore_upgradebackup
|
|
|
-}
|
|
|
-# Exit if an error occurs during the execution of the script
|
|
|
-ynh_abort_if_errors
|
|
|
-
|
|
|
#=================================================
|
|
|
# CHECK THE PATH
|
|
|
#=================================================
|
|
|
@@ -81,10 +68,23 @@ zabbixFrontendInstalledVersion=$(apt-cache policy zabbix-frontend-php | grep -Po
|
|
|
zabbixFrontendCandidateVersion=$(apt-cache policy zabbix-frontend-php | grep -Po "Candidate: \K(.*)")
|
|
|
|
|
|
zabbixagentInstalledVersion=$(apt-cache policy zabbix-agent | grep -Po "Installed: \K(.*)")
|
|
|
-zabbixagentCandidateVersion=$(apt-cache policy zabbix-zabbix-agent | grep -Po "Candidate: \K(.*)")
|
|
|
+zabbixagentCandidateVersion=$(apt-cache policy zabbix-agent | grep -Po "Candidate: \K(.*)")
|
|
|
|
|
|
-if [ "$zabbixServerInstalledVersion" == "$zabbixServerCandidateVersion" -a "$zabbixFrontendInstalledVersion" == "$zabbixFrontendCandidateVersion" -a "$zabbixagentInstalledVersion" == "$zabbixagentCandidateVersion" ]
|
|
|
+if [ "$zabbixServerInstalledVersion" != "$zabbixServerCandidateVersion" -o "$zabbixFrontendInstalledVersion" != "$zabbixFrontendCandidateVersion" -o "$zabbixagentInstalledVersion" != "$zabbixagentCandidateVersion" ]
|
|
|
then
|
|
|
+ #=================================================
|
|
|
+ # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
|
|
+ #=================================================
|
|
|
+
|
|
|
+ # Backup the current version of the app
|
|
|
+ ynh_backup_before_upgrade
|
|
|
+ ynh_clean_setup () {
|
|
|
+ # restore it if the upgrade fails
|
|
|
+ ynh_restore_upgradebackup
|
|
|
+ }
|
|
|
+ # Exit if an error occurs during the execution of the script
|
|
|
+ ynh_abort_if_errors
|
|
|
+
|
|
|
cp -rp /etc/zabbix /tmp/
|
|
|
cp -p /usr/share/zabbix/conf/zabbix.conf.php /tmp/
|
|
|
|