1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
#!/bin/sh
set -e
# If /tmp/ZABBIX_PACKAGE_DEBUG file exists then enable debugging of this script.
#if [ -e /tmp/ZABBIX_PACKAGE_DEBUG ]; then
# set -x
#fi
CONFFILE="/usr/share/zabbix-agent/zabbix_agentd.conf"
CONFFILE_DEST="/etc/zabbix/zabbix_agentd.conf"
if [ "$1" = "configure" ]; then
# Does the user 'zabbix' exist?
if ! getent passwd zabbix > /dev/null 2>&1 ; then
# Not yet. Create it.
adduser --quiet --system --group --disabled-login --no-create-home --home /nonexistent zabbix
fi
# Use ucf to handle the zabbix_agentd.conf configuration file
ucf $CONFFILE $CONFFILE_DEST
ucfr zabbix-agent $CONFFILE_DEST
chown zabbix:zabbix /var/log/zabbix-agent -R
fi
#DEBHELPER#
|