icinga2/debian/icinga2-ido-mysql.postinst

44 lines
1.1 KiB
Bash

#!/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-mysql.conf'
dbc_generate_include_owner='nagios:nagios'
dbc_generate_include_args='--ucf -o template_infile=/usr/share/icinga2/tmpl/ido-mysql.conf-sample'
dbc_go icinga2-ido-mysql $@
if [ "$1" = configure ]; then
# get values from debconf db
db_get icinga2-ido-mysql/enable
if [ "$RET" = "false" ]; then
if [ -L /etc/icinga2/features-enabled/ido-mysql.conf ]
then
echo "disable ido mysql feature"
icinga2-disable-feature ido-mysql
echo "reloading icinga2"
[ -x $(which invoke-rc.d) ] && invoke-rc.d icinga2 reload
fi
else
if [ ! -L /etc/icinga2/features-enabled/ido-mysql.conf ]
then
echo "enable ido mysql feature"
icinga2-enable-feature ido-mysql
echo "reloading icinga2"
[ -x $(which invoke-rc.d) ] && invoke-rc.d icinga2 reload
fi
fi
fi
#DEBHELPER#
db_stop