2014-06-16 16:14:31 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
. /usr/share/debconf/confmodule
|
|
|
|
. /usr/share/dbconfig-common/dpkg/postinst
|
|
|
|
|
|
|
|
#dbc_debug='1'
|
|
|
|
dbc_generate_include='template:/etc/icinga2/features-available/ido-pgsql.conf'
|
|
|
|
dbc_generate_include_owner='nagios:nagios'
|
|
|
|
dbc_generate_include_args='--ucf -o template_infile=/usr/share/icinga2/tmpl/ido-pgsql.conf-sample'
|
|
|
|
dbc_go icinga2-ido-pgsql $@
|
|
|
|
|
|
|
|
|
|
|
|
if [ "$1" = configure ]; then
|
|
|
|
|
|
|
|
# get values from debconf db
|
|
|
|
db_get icinga2-ido-pgsql/enable
|
|
|
|
|
|
|
|
if [ "$RET" = "false" ]; then
|
|
|
|
if [ -L /etc/icinga2/features-enabled/ido-pgsql.conf ]
|
|
|
|
then
|
|
|
|
echo "disable ido pgsql feature"
|
2014-10-14 18:32:15 +02:00
|
|
|
icinga2 feature disable ido-pgsql
|
2014-06-16 16:14:31 +02:00
|
|
|
echo "reloading icinga2"
|
|
|
|
[ -x $(which invoke-rc.d) ] && invoke-rc.d icinga2 reload
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
if [ ! -L /etc/icinga2/features-enabled/ido-pgsql.conf ]
|
|
|
|
then
|
|
|
|
echo "enable ido pgsql feature"
|
2014-12-18 06:12:26 +01:00
|
|
|
icinga2 feature disable ido-pgsql
|
2014-06-16 16:14:31 +02:00
|
|
|
echo "reloading icinga2"
|
|
|
|
[ -x $(which invoke-rc.d) ] && invoke-rc.d icinga2 reload
|
|
|
|
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
#DEBHELPER#
|
|
|
|
db_stop
|
|
|
|
|
|
|
|
|