]> ##&name; ### 2020-07-14 - Initial commit echo "Installation of zabbix_agent plugin started." mkdir -p /boot/config/plugins/zabbix_agent/scripts if [ -e /boot/config/plugins/zabbix_agent/zabbix_agentd-&agent_version; ]; then echo "Agent already exists. Using local files." else echo "zabbix_agent version &agent_version; not found." echo "Removing old files..." rm /boot/config/plugins/zabbix_agent/zabbix_agentd-* rm /boot/config/plugins/zabbix_agent/rc.zabbix_agentd rm /boot/config/plugins/zabbix_agent/zabbix_agentd.conf rm /boot/config/plugins/zabbix_agent/scripts/* echo "Downloading &agentURL;..." wget "&agentURL;" -O /boot/config/plugins/zabbix_agent/zabbix_agentd-&agent_version; fi /dev/null`; do echo -n "." sleep 1 COUNT=$((COUNT+1)) if [ $COUNT -ge 30 ]; then killall -9 zabbix_agentd sleep 1 break fi done echo " DONE" } # See how we were called. case "$1" in start) start ;; stop) stop ;; restart|reload) stop start ;; *) echo $"Usage: $0 {start|stop|restart}" ;; esac ]]> cp /boot/config/plugins/zabbix_agent/rc.zabbix_agentd /etc/rc.d/rc.zabbix_agentd chmod +x /etc/rc.d/rc.zabbix_agentd mkdir -p /usr/local/emhttp/plugins/zabbix_agent/scripts cp -R /boot/config/plugins/zabbix_agent/scripts/* /usr/local/emhttp/plugins/zabbix_agent/scripts/ chmod +x /usr/local/emhttp/plugins/zabbix_agent/scripts/* /etc/rc.d/rc.zabbix_agentd stop cp /boot/config/plugins/zabbix_agent/zabbix_agentd-&agent_version; /usr/sbin/zabbix_agentd chmod +x /usr/sbin/zabbix_agentd /etc/rc.d/rc.zabbix_agentd start echo "Removal of zabbix_agent plugin started." echo "Stopping zabbix_agentd..." /etc/rc.d/rc.zabbix_agentd stop echo "Deleting /usr/sbin/zabbix_agentd..." rm /usr/sbin/zabbix_agentd echo "Deleting /boot/config/plugins/zabbix_agent..." rm -rf /boot/config/plugins/zabbix_agent echo "Deleting /usr/local/emhttp/plugins/zabbix_agent..." rm -rf /usr/local/emhttp/plugins/zabbix_agent echo "Removal of zabbix_agent plugin completed."