diff --git a/build.sh b/build.sh index 2b5b715..1b70fa8 100755 --- a/build.sh +++ b/build.sh @@ -1,6 +1,6 @@ #!/bin/bash VERSION=`xpath -q -e 'string(//PLUGIN/@version)' zabbix_agent.plg` -FILE="zabbix_agent-$VERSION.package.tgz" +FILE="zabbix_agent-$VERSION-x86_64-1.txz" echo "Version in plugin file: $VERSION" echo "Generated file will be: $FILE" @@ -29,7 +29,7 @@ read echo "Creating $FILE..." echo -tar -czvf "$FILE" files +tar -cv --owner=root --group=root --lzma -C files -f "$FILE" . echo read md5 _ < <(md5sum "$FILE") echo "MD5 of the resulting file for the plugin file: $md5" diff --git a/zabbix_agent.plg b/zabbix_agent.plg index 04fc3f4..bce26ce 100644 --- a/zabbix_agent.plg +++ b/zabbix_agent.plg @@ -7,7 +7,7 @@ - + ]> @@ -55,8 +55,9 @@ if [ -x /etc/rc.d/rc.zabbix_agentd ]; then fi echo "Extracting support files..." -tar -xzvf /boot/config/plugins/zabbix_agent/&packageName; --strip=1 -C / +upgradepkg --install-new /boot/config/plugins/zabbix_agent/&packageName; +echo "Starting zabbix_agent..." /etc/rc.d/rc.zabbix_agentd start @@ -67,14 +68,13 @@ tar -xzvf /boot/config/plugins/zabbix_agent/&packageName; --strip=1 -C / 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 /etc/rc.d/rc.zabbix_agentd..." -rm /etc/rc.d/rc.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 "Uninstalling package..." +removepkg zabbix_agent + +echo "Removing remaining plugin files..." +rm -rf /boot/config/plugins/zabbix_agent + echo "Removal of zabbix_agent plugin completed."