11#! /usr/bin/env bash
22source <( curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3- # Copyright (c) 2021-2025 tteck
4- # Author: tteck (tteckster )
3+ # Copyright (c) 2021-2025 community-scripts ORG
4+ # Author: MickLesk (CanbiZ )
55# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
66# Source: https://www.zabbix.com/
77
@@ -20,40 +20,43 @@ color
2020catch_errors
2121
2222function update_script() {
23- header_info
24- check_container_storage
25- check_container_resources
26- if [[ ! -f /etc/zabbix/zabbix_server.conf ]]; then
27- msg_error " No ${APP} Installation Found!"
28- exit
29- fi
30- msg_info " Stopping ${APP} Services"
31- systemctl stop zabbix-server zabbix-agent2
32- msg_ok " Stopped ${APP} Services"
23+ header_info
24+ check_container_storage
25+ check_container_resources
26+ if [[ ! -f /etc/zabbix/zabbix_server.conf ]]; then
27+ msg_error " No ${APP} Installation Found!"
28+ exit
29+ fi
30+ msg_info " Stopping ${APP} Services"
31+ systemctl stop zabbix-server zabbix-agent2
32+ msg_ok " Stopped ${APP} Services"
3333
34- msg_info " Updating $APP LXC"
35- mkdir -p /opt/zabbix-backup/
36- cp /etc/zabbix/zabbix_server.conf /opt/zabbix-backup/
37- cp /etc/apache2/conf-enabled/zabbix.conf /opt/zabbix-backup/
38- cp -R /usr/share/zabbix/ /opt/zabbix-backup/
39- # cp -R /usr/share/zabbix-* /opt/zabbix-backup/ Remove temporary
40- rm -Rf /etc/apt/sources.list.d/zabbix.list
41- cd /tmp
42- curl -fsSL " https://repo.zabbix.com/zabbix/7.2/release/debian/pool/main/z/zabbix-release/zabbix-release_latest+debian12_all.deb" -o $( basename " https://repo.zabbix.com/zabbix/7.2/release/debian/pool/main/z/zabbix-release/zabbix-release_latest+debian12_all.deb" )
43- $STD dpkg -i zabbix-release_latest+debian12_all.deb
44- $STD apt-get update
45- $STD apt-get install --only-upgrade zabbix-server-pgsql zabbix-frontend-php zabbix-agent2 zabbix-agent2-plugin-*
34+ msg_info " Updating $APP LXC"
35+ mkdir -p /opt/zabbix-backup/
36+ cp /etc/zabbix/zabbix_server.conf /opt/zabbix-backup/
37+ cp /etc/apache2/conf-enabled/zabbix.conf /opt/zabbix-backup/
38+ cp -R /usr/share/zabbix/ /opt/zabbix-backup/
39+ # cp -R /usr/share/zabbix-* /opt/zabbix-backup/ Remove temporary
40+ rm -Rf /etc/apt/sources.list.d/zabbix.list
41+ cd /tmp || exit
42+ curl -fsSL " $( curl -fsSL https://repo.zabbix.com/zabbix/ |
43+ grep -oP ' (?<=href=")[0-9]+\.[0-9]+(?=/")' | sort -V | tail -n1 |
44+ xargs -I{} echo " https://repo.zabbix.com/zabbix/{}/release/debian/pool/main/z/zabbix-release/zabbix-release_latest+debian12_all.deb" ) " \
45+ -o /tmp/zabbix-release_latest+debian12_all.deb
46+ $STD dpkg -i zabbix-release_latest+debian12_all.deb
47+ $STD apt-get update
48+ $STD apt-get install --only-upgrade zabbix-server-pgsql zabbix-frontend-php zabbix-agent2 zabbix-agent2-plugin-*
4649
47- msg_info " Starting ${APP} Services"
48- systemctl start zabbix-server zabbix-agent2
49- systemctl restart apache2
50- msg_ok " Started ${APP} Services"
50+ msg_info " Starting ${APP} Services"
51+ systemctl start zabbix-server zabbix-agent2
52+ systemctl restart apache2
53+ msg_ok " Started ${APP} Services"
5154
52- msg_info " Cleaning Up"
53- rm -rf /tmp/zabbix-release_latest+debian12_all.deb
54- msg_ok " Cleaned"
55- msg_ok " Updated Successfully"
56- exit
55+ msg_info " Cleaning Up"
56+ rm -rf /tmp/zabbix-release_latest+debian12_all.deb
57+ msg_ok " Cleaned"
58+ msg_ok " Updated Successfully"
59+ exit
5760}
5861
5962start
0 commit comments