File tree Expand file tree Collapse file tree 2 files changed +24
-5
lines changed
Expand file tree Collapse file tree 2 files changed +24
-5
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,12 @@ function update_script() {
4242 fi
4343
4444 msg_info " Stopping Services"
45- systemctl stop zabbix-server $AGENT_SERVICE
45+ $STD systemctl stop zabbix-server
46+ if systemctl list-unit-files | grep -q zabbix-agent2; then
47+ $STD systemctl stop zabbix-agent2
48+ else
49+ $STD systemctl stop zabbix-agent
50+ fi
4651 msg_ok " Stopped Services"
4752
4853 msg_info " Updating Zabbix"
@@ -83,14 +88,22 @@ function update_script() {
8388 msg_ok " Updated Zabbix"
8489
8590 msg_info " Starting Services"
86- systemctl start zabbix-server $AGENT_SERVICE
91+ $STD systemctl start zabbix-server
92+ if systemctl list-unit-files | grep -q zabbix-agent2; then
93+ $STD systemctl start zabbix-agent2
94+ else
95+ $STD systemctl start zabbix-agent
96+ fi
8797 systemctl restart apache2
8898 msg_ok " Started Services"
8999
90100 msg_info " Cleaning Up"
91101 rm -rf /tmp/zabbix-release_latest+debian13_all.deb
102+ $STD apt -y autoremove
103+ $STD apt -y autoclean
104+ $STD apt -y clean
92105 msg_ok " Cleaned"
93- msg_ok " Updated Successfully"
106+ msg_ok " Updated Successfully! "
94107 exit
95108}
96109
Original file line number Diff line number Diff line change 102102msg_ok " Configured Fping"
103103
104104msg_info " Starting Services"
105- systemctl restart zabbix-server zabbix-agent2 apache2
106- systemctl enable -q --now zabbix-server zabbix-agent2 apache2
105+ if [ " $AGENT_PKG " = " zabbix-agent2" ]; then
106+ AGENT_SERVICE=" zabbix-agent2"
107+ else
108+ AGENT_SERVICE=" zabbix-agent"
109+ fi
110+
111+ systemctl restart zabbix-server
112+ systemctl enable -q --now zabbix-server $AGENT_SERVICE apache2
107113msg_ok " Started Services"
108114
109115motd_ssh
You can’t perform that action at this time.
0 commit comments